authentik: move inlined python modules to the standard python modules (#338629)

This commit is contained in:
jopejoe1 2024-11-08 14:03:11 +01:00 committed by GitHub
commit 9deddb4eb1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 225 additions and 105 deletions

View File

@ -110,75 +110,15 @@ let
python = python312.override {
self = python;
packageOverrides = final: prev: {
django-tenants = prev.buildPythonPackage rec {
pname = "django-tenants";
version = "unstable-2024-01-11";
django-tenants = prev.django-tenants.overrideAttrs {
version = "3.6.1-unstable-2024-01-11";
src = fetchFromGitHub {
owner = "rissson";
repo = pname;
repo = "django-tenants";
rev = "a7f37c53f62f355a00142473ff1e3451bb794eca";
hash = "sha256-YBT0kcCfETXZe0j7/f1YipNIuRrcppRVh1ecFS3cvNo=";
};
format = "setuptools";
doCheck = false; # Tests require postgres
propagatedBuildInputs = with final; [
django
psycopg
gunicorn
];
};
django-cte = prev.buildPythonPackage rec {
pname = "django-cte";
version = "1.3.3";
src = fetchFromGitHub {
owner = "dimagi";
repo = pname;
rev = "v${version}";
hash = "sha256-OCENg94xHBeeE4A2838Cu3q2am2im2X4SkFSjc6DuhE=";
};
doCheck = false; # Tests require postgres
format = "setuptools";
};
django-pgactivity = prev.buildPythonPackage rec {
pname = "django-pgactivity";
version = "1.4.1";
src = fetchFromGitHub {
owner = "Opus10";
repo = pname;
rev = version;
hash = "sha256-VwH7fwLcoH2Z9D/OY9iieM0cRhyDKOpAzqQ+4YVE3vU=";
};
nativeBuildInputs = with prev; [
poetry-core
];
propagatedBuildInputs = with final; [
django
];
pyproject = true;
};
django-pglock = prev.buildPythonPackage rec {
pname = "django-pglock";
version = "1.5.1";
src = fetchFromGitHub {
owner = "Opus10";
repo = pname;
rev = version;
hash = "sha256-ZoEHDkGmrcNiMe/rbwXsEPZo3LD93cZp6zjftMKjLeg=";
};
nativeBuildInputs = with prev; [
poetry-core
];
propagatedBuildInputs = with final; [
django
django-pgactivity
];
pyproject = true;
};
# Use 3.14.0 until https://github.com/encode/django-rest-framework/issues/9358 is fixed.
# Otherwise applying blueprints/default/default-brand.yaml fails with:
# authentik.flows.models.RelatedObjectDoesNotExist: FlowStageBinding has no target.
@ -213,48 +153,6 @@ let
pythonImportsCheck = [ "rest_framework" ];
};
tenant-schemas-celery = prev.buildPythonPackage rec {
pname = "tenant-schemas-celery";
version = "3.0.0";
src = fetchFromGitHub {
owner = "maciej-gol";
repo = pname;
rev = version;
hash = "sha256-3ZUXSAOBMtj72sk/VwPV24ysQK+E4l1HdwKa78xrDtg=";
};
format = "setuptools";
doCheck = false;
propagatedBuildInputs = with final; [
freezegun
more-itertools
psycopg2
];
};
scim2-filter-parser = prev.buildPythonPackage rec {
pname = "scim2-filter-parser";
version = "0.5.1";
# For some reason the normal fetchPypi does not work
src = fetchzip {
url = "https://files.pythonhosted.org/packages/54/df/ad9718acce76e81a93c57327356eecd23701625f240fbe03d305250399e6/scim2_filter_parser-0.5.1.tar.gz";
hash = "sha256-DZAdRj6qyySggsvJZC47vdvXbHrB1ra3qiYBEUiceJ4=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail 'poetry>=0.12' 'poetry-core>=1.0.0' \
--replace-fail 'poetry.masonry.api' 'poetry.core.masonry.api'
'';
nativeBuildInputs = [ prev.poetry-core ];
pyproject = true;
propagatedBuildInputs = with final; [
sly
];
};
authentik-django = prev.buildPythonPackage {
pname = "authentik-django";
inherit version src meta;

View File

@ -0,0 +1,64 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
pytestCheckHook,
unittestCheckHook,
setuptools,
django,
}:
buildPythonPackage rec {
pname = "django-cte";
version = "1.3.3";
pyproject = true;
src = fetchFromGitHub {
owner = "dimagi";
repo = "django-cte";
rev = "refs/tags/v${version}";
hash = "sha256-OCENg94xHBeeE4A2838Cu3q2am2im2X4SkFSjc6DuhE=";
};
build-system = [ setuptools ];
dependencies = [ django ];
nativeCheckInputs = [ pytestCheckHook ];
disabledTests = [
# Require Database connection
"test_cte_queryset"
"test_experimental_left_outer_join"
"test_explain"
"test_left_outer_join_on_empty_result_set_cte"
"test_named_ctes"
"test_named_simple_ctes"
"test_non_cte_subquery"
"test_outerref_in_cte_query"
"test_simple_cte_query"
"test_update_cte_query"
"test_update_with_subquery"
"test_heterogeneous_filter_in_cte"
"test_raw_cte_sql"
"test_alias_as_subquery"
"test_alias_change_in_annotation"
"test_attname_should_not_mask_col_name"
"test_pickle_recursive_cte_queryset"
"test_recursive_cte_query"
"test_recursive_cte_reference_in_condition"
"test_union_with_first"
"test_union_with_select_related_and_first"
"test_union_with_select_related_and_order"
];
pythonImportsCheck = [ "django_cte" ];
meta = {
description = "Common Table Expressions (CTE) for Django";
homepage = "https://github.com/dimagi/django-cte";
changelog = "https://github.com/dimagi/django-cte/blob/v${version}/CHANGELOG.md";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ jopejoe1 ];
};
}

View File

@ -0,0 +1,38 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
poetry-core,
django,
psycopg,
}:
buildPythonPackage rec {
pname = "django-pgactivity";
version = "1.5.0";
pyproject = true;
src = fetchFromGitHub {
owner = "Opus10";
repo = "django-pgactivity";
rev = "refs/tags/${version}";
hash = "sha256-jOpm/vYy3Ubi+NfvARH19ozZMUgyGD/ZztqxKNvAoLQ=";
};
build-system = [ poetry-core ];
dependencies = [
django
psycopg
];
pythonImportsCheck = [ "pgactivity" ];
meta = {
description = "View, filter, and kill Postgres queries";
homepage = "https://github.com/Opus10/django-pgactivity";
changelog = "https://github.com/Opus10/django-pgactivity/blob/${version}/CHANGELOG.md";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ jopejoe1 ];
};
}

View File

@ -0,0 +1,38 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
poetry-core,
django,
django-pgactivity,
}:
buildPythonPackage rec {
pname = "django-pglock";
version = "1.6.0";
pyproject = true;
src = fetchFromGitHub {
owner = "Opus10";
repo = "django-pglock";
rev = "refs/tags/${version}";
hash = "sha256-KCB00W3sUyEERgK/DfDPl051uFkc0IRdbOJusUVs5SA=";
};
build-system = [ poetry-core ];
dependencies = [
django
django-pgactivity
];
pythonImportsCheck = [ "pglock" ];
meta = {
description = "Postgres advisory locks, table locks, and blocking lock management";
homepage = "https://github.com/Opus10/django-pglock";
changelog = "https://github.com/Opus10/django-pglock/blob/${version}/CHANGELOG.md";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ jopejoe1 ];
};
}

View File

@ -0,0 +1,38 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
django,
psycopg,
}:
buildPythonPackage rec {
pname = "django-tenants";
version = "3.7.0";
pyproject = true;
src = fetchFromGitHub {
owner = "django-tenants";
repo = "django-tenants";
rev = "refs/tags/v${version}";
hash = "sha256-QdEONKVFW/DWBjXWRTG+ahvirw9BP8M6PztUMZGZ33Q=";
};
build-system = [ setuptools ];
dependencies = [
django
psycopg
];
pythonImportsCheck = [ "django_tenants" ];
meta = {
description = "Django tenants using PostgreSQL Schemas";
homepage = "https://github.com/django-tenants/django-tenants";
changelog = "https://github.com/django-tenants/django-tenants/releases/tag/v${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ jopejoe1 ];
};
}

View File

@ -0,0 +1,34 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
celery,
}:
buildPythonPackage rec {
pname = "tenant-schemas-celery";
version = "3.0.0";
pyproject = true;
src = fetchFromGitHub {
owner = "maciej-gol";
repo = "tenant-schemas-celery";
rev = "refs/tags/${version}";
hash = "sha256-3ZUXSAOBMtj72sk/VwPV24ysQK+E4l1HdwKa78xrDtg=";
};
build-system = [ setuptools ];
dependencies = [ celery ];
pythonImportsCheck = [ "tenant_schemas_celery" ];
meta = {
description = "Celery application implementation that allows celery tasks to cooperate with multi-tenancy provided by django-tenant-schemas and django-tenants packages";
homepage = "https://github.com/maciej-gol/tenant-schemas-celery";
changelog = "https://github.com/maciej-gol/tenant-schemas-celery/releases/tag/${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ jopejoe1 ];
};
}

View File

@ -3395,6 +3395,8 @@ self: super: with self; {
django-csp = callPackage ../development/python-modules/django-csp { };
django-cte = callPackage ../development/python-modules/django-cte { };
django-currentuser = callPackage ../development/python-modules/django-currentuser { };
django-debug-toolbar = callPackage ../development/python-modules/django-debug-toolbar { };
@ -3499,6 +3501,10 @@ self: super: with self; {
django-payments = callPackage ../development/python-modules/django-payments { };
django-pgactivity = callPackage ../development/python-modules/django-pgactivity { };
django-pglock = callPackage ../development/python-modules/django-pglock { };
django-pglocks = callPackage ../development/python-modules/django-pglocks { };
django-phonenumber-field = callPackage ../development/python-modules/django-phonenumber-field { };
@ -3599,6 +3605,8 @@ self: super: with self; {
django-tastypie = callPackage ../development/python-modules/django-tastypie { };
django-tenants = callPackage ../development/python-modules/django-tenants { };
django-timezone-field = callPackage ../development/python-modules/django-timezone-field { };
django-tinymce = callPackage ../development/python-modules/django-tinymce { };
@ -15509,6 +15517,8 @@ self: super: with self; {
tenacity = callPackage ../development/python-modules/tenacity { };
tenant-schemas-celery = callPackage ../development/python-modules/tenant-schemas-celery { };
tencentcloud-sdk-python = callPackage ../development/python-modules/tencentcloud-sdk-python { };
tendo = callPackage ../development/python-modules/tendo { };