From 1702818a2827426440752dfabed0122001b6d85b Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 18 Apr 2026 01:01:27 +0200 Subject: [PATCH] python3Packages.dj-rest-auth: 7.0.2 -> 7.2.0 https://github.com/iMerica/dj-rest-auth/releases/tag/7.2.0 --- .../python-modules/dj-rest-auth/default.nix | 54 +++++++------------ 1 file changed, 19 insertions(+), 35 deletions(-) diff --git a/pkgs/development/python-modules/dj-rest-auth/default.nix b/pkgs/development/python-modules/dj-rest-auth/default.nix index ff05d3f18d16..64a110368d99 100644 --- a/pkgs/development/python-modules/dj-rest-auth/default.nix +++ b/pkgs/development/python-modules/dj-rest-auth/default.nix @@ -6,36 +6,27 @@ djangorestframework, djangorestframework-simplejwt, fetchFromGitHub, - fetchpatch, python, responses, setuptools, unittest-xml-reporting, + pyotp, pytestCheckHook, pytest-django, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "dj-rest-auth"; - version = "7.0.2"; + version = "7.2.0"; pyproject = true; src = fetchFromGitHub { owner = "iMerica"; repo = "dj-rest-auth"; - tag = version; - hash = "sha256-tgcEnB9n9pq+TBde8udsr8osdAAJqmXaaU1Wt2psPIw="; + tag = finalAttrs.version; + hash = "sha256-eUcve2KPcLjKKWU7AxQEZ0mokP185E43Xjm4b+4hQzA="; }; - patches = [ - # See https://github.com/iMerica/dj-rest-auth/pull/683 - (fetchpatch { - name = "djangorestframework-simplejwt_5.5_compatibility.patch"; - url = "https://github.com/iMerica/dj-rest-auth/commit/cc5587e4e3f327697709f3f0d491650bff5464e7.diff"; - hash = "sha256-2LahibxuNECAfjqsbNs2ezaWt1VH0ZBNwSNWCZwIe8I="; - }) - ]; - postPatch = '' substituteInPlace setup.py \ --replace-fail "==" ">=" @@ -47,22 +38,24 @@ buildPythonPackage rec { dependencies = [ djangorestframework ]; - optional-dependencies.with_social = [ - django-allauth - ] - ++ django-allauth.optional-dependencies.socialaccount; + optional-dependencies = { + with_social = [ + django-allauth + ] + ++ django-allauth.optional-dependencies.socialaccount; + with_mfa = [ + pyotp + ]; + }; nativeCheckInputs = [ djangorestframework-simplejwt + pytestCheckHook + pytest-django responses unittest-xml-reporting ] - ++ optional-dependencies.with_social; - - checkInputs = [ - pytestCheckHook - pytest-django - ]; + ++ lib.concatAttrValues finalAttrs.passthru.optional-dependencies; env.DJANGO_SETTINGS_MODULE = "dj_rest_auth.tests.settings"; @@ -74,15 +67,6 @@ buildPythonPackage rec { disabledTests = [ # Test connects to graph.facebook.com "TestSocialLoginSerializer" - # claim[user_id] is "1" (str) vs 1 (int) - "test_custom_jwt_claims" - "test_custom_jwt_claims_cookie_w_authentication" - ]; - - disabledTestPaths = [ - # Test fails with > django-allauth 65.4 - # See: https://github.com/iMerica/dj-rest-auth/pull/681#issuecomment-3034953311 - "dj_rest_auth/tests/test_social.py" ]; pythonImportsCheck = [ "dj_rest_auth" ]; @@ -90,8 +74,8 @@ buildPythonPackage rec { meta = { description = "Authentication for Django Rest Framework"; homepage = "https://github.com/iMerica/dj-rest-auth"; - changelog = "https://github.com/iMerica/dj-rest-auth/releases/tag/${src.tag}"; + changelog = "https://github.com/iMerica/dj-rest-auth/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ onny ]; }; -} +})