diff --git a/pkgs/by-name/gl/glitchtip/package.nix b/pkgs/by-name/gl/glitchtip/package.nix index 194c96134d45..60e7ef7aae3a 100644 --- a/pkgs/by-name/gl/glitchtip/package.nix +++ b/pkgs/by-name/gl/glitchtip/package.nix @@ -29,6 +29,7 @@ let django django-allauth django-anymail + django-async-backend django-cors-headers django-environ django-extensions diff --git a/pkgs/development/python-modules/django-async-backend/default.nix b/pkgs/development/python-modules/django-async-backend/default.nix new file mode 100644 index 000000000000..404ecff96939 --- /dev/null +++ b/pkgs/development/python-modules/django-async-backend/default.nix @@ -0,0 +1,74 @@ +{ + lib, + buildPythonPackage, + django, + fetchFromGitHub, + poetry-core, + postgresql, + postgresqlTestHook, + psycopg, + psycopg-pool, + pytest-django, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "django-async-backend"; + version = "6.0.7"; + pyproject = true; + + src = fetchFromGitHub { + owner = "Arfey"; + repo = "django-async-backend"; + tag = "v${version}"; + hash = "sha256-4zaXPfHIE9RwkSbHPt1DHFInn8LP+JXiBiMJYkZeR6M="; + }; + + postPatch = '' + substituteInPlace tests/settings.py \ + --replace-fail '"HOST": "localhost"' '"HOST": "/build/run/postgresql"' + + substituteInPlace tests/db/backends/postgresql/test_async_backend.py \ + --replace-fail "new_connection.get_database_version())[0], 15" "new_connection.get_database_version())[0], ${lib.versions.major postgresql.version}" + ''; + + build-system = [ poetry-core ]; + + dependencies = [ + django + psycopg + ]; + + pythonImportsCheck = [ "django_async_backend" ]; + + env = { + DJANGO_SETTINGS_MODULE = "settings"; + PGDATABASE = "postgres"; + PGUSER = "postgres"; + }; + + preCheck = '' + export PYTHONPATH=$PYTHONPATH:$PWD/tests + ''; + + nativeCheckInputs = [ + django # must come first as vtasks only works with django 6 + + postgresql + postgresqlTestHook + psycopg-pool + pytest-django + pytestCheckHook + ]; + + pytestFlags = [ "./tests" ]; + + meta = { + description = "Django extension providing async capabilities for database and other components"; + homepage = "https://github.com/Arfey/django-async-backend"; + changelog = "https://github.com/Arfey/django-async-backend/releases/tag/${src.tag}"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ SuperSandro2000 ]; + broken = lib.versionOlder (lib.versions.major django.version) "6"; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b46df1489f11..d541bce8d91e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4138,6 +4138,8 @@ self: super: with self; { django-apscheduler = callPackage ../development/python-modules/django-apscheduler { }; + django-async-backend = callPackage ../development/python-modules/django-async-backend { }; + django-auditlog = callPackage ../development/python-modules/django-auditlog { }; django-auth-ldap = callPackage ../development/python-modules/django-auth-ldap {