diff --git a/pkgs/by-name/au/authentik/package.nix b/pkgs/by-name/au/authentik/package.nix index 47cf9d09be49..8f0f4d50aa4e 100644 --- a/pkgs/by-name/au/authentik/package.nix +++ b/pkgs/by-name/au/authentik/package.nix @@ -110,19 +110,6 @@ let python = python312.override { self = python; packageOverrides = final: prev: { - 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"; diff --git a/pkgs/development/python-modules/django-cte/default.nix b/pkgs/development/python-modules/django-cte/default.nix new file mode 100644 index 000000000000..1ccf00d9aaea --- /dev/null +++ b/pkgs/development/python-modules/django-cte/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a9c6f5f24ccb..034a7c8d9f13 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3315,6 +3315,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 { };