From 026247dfbab6d231f2dce79a5c648d97307c5a41 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 13 May 2024 09:35:46 +0200 Subject: [PATCH 1/7] python312Packages.unittest-xml-reporting: disable failing test --- .../unittest-xml-reporting/default.nix | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/unittest-xml-reporting/default.nix b/pkgs/development/python-modules/unittest-xml-reporting/default.nix index 36768b0fccb7..154c1885d051 100644 --- a/pkgs/development/python-modules/unittest-xml-reporting/default.nix +++ b/pkgs/development/python-modules/unittest-xml-reporting/default.nix @@ -1,26 +1,32 @@ { lib -, fetchFromGitHub , buildPythonPackage +, fetchFromGitHub , lxml +, pytestCheckHook , pythonAtLeast , pythonOlder -, pytestCheckHook +, setuptools }: buildPythonPackage rec { pname = "unittest-xml-reporting"; version = "3.2.0"; - format = "setuptools"; + pyproject = true; + disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "xmlrunner"; repo = "unittest-xml-reporting"; - rev = version; + rev = "refs/tags/${version}"; hash = "sha256-lOJ/+8CVJUXdIaZLLF5PpPkG0DzlNgo46kRZ1Xy7Ju0="; }; - propagatedBuildInputs = [ + build-system = [ + setuptools + ]; + + dependencies = [ lxml ]; @@ -28,17 +34,20 @@ buildPythonPackage rec { pytestCheckHook ]; - pytestFlagsArray = lib.optionals (pythonAtLeast "3.11") [ + disabledTests = lib.optionals (pythonAtLeast "3.11") [ # AttributeError: 'tuple' object has no attribute 'shortDescription' - "--deselect=tests/testsuite.py::XMLTestRunnerTestCase::test_basic_unittest_constructs" - "--deselect=tests/testsuite.py::XMLTestRunnerTestCase::test_unexpected_success" + "test_basic_unittest_constructs" + "test_unexpected_success" + ] ++ lib.optionals (pythonAtLeast "3.12") [ + "test_xmlrunner_hold_traceback" ]; pythonImportsCheck = [ "xmlrunner" ]; meta = with lib; { + description = "Unittest-based test runner with Ant/JUnit like XML reporting"; homepage = "https://github.com/xmlrunner/unittest-xml-reporting"; - description = "unittest-based test runner with Ant/JUnit like XML reporting"; + changelog = "https://github.com/xmlrunner/unittest-xml-reporting/releases/tag/${version}"; license = licenses.bsd2; maintainers = with maintainers; [ rprospero ]; }; From 6924256de0429055ce49223b5864b6dbb350812f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 13 May 2024 09:52:48 +0200 Subject: [PATCH 2/7] python312Packages.dj-rest-auth: 5.0.2 -> 6.0.0 Changelog: https://github.com/iMerica/dj-rest-auth/releases/tag/6.0.0 --- .../python-modules/dj-rest-auth/default.nix | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/pkgs/development/python-modules/dj-rest-auth/default.nix b/pkgs/development/python-modules/dj-rest-auth/default.nix index e415977d8637..63575b278b6b 100644 --- a/pkgs/development/python-modules/dj-rest-auth/default.nix +++ b/pkgs/development/python-modules/dj-rest-auth/default.nix @@ -5,7 +5,6 @@ , djangorestframework , djangorestframework-simplejwt , fetchFromGitHub -, fetchpatch , python , pythonOlder , responses @@ -15,33 +14,26 @@ buildPythonPackage rec { pname = "dj-rest-auth"; - version = "5.0.2"; + version = "6.0.0"; pyproject = true; - disabled = pythonOlder "3.6"; + disabled = pythonOlder "3.8"; src = fetchFromGitHub { owner = "iMerica"; repo = "dj-rest-auth"; rev = "refs/tags/${version}"; - hash = "sha256-TqeNpxXn+v89fEiJ4AVNhp8blCfYQKFQfYmZ6/QlRbQ="; + hash = "sha256-fNy1uN3oH54Wd9+EqYpiV0ot1MbSSC7TZoAARQeR81s="; }; - patches = [ - # https://github.com/iMerica/dj-rest-auth/pull/597 - (fetchpatch { - name = "disable-email-confirmation-ratelimit-in-tests-to-support-new-allauth.patch"; - url = "https://github.com/iMerica/dj-rest-auth/commit/c8f19e18a93f4959da875f9c5cdd32f7d9363bba.patch"; - hash = "sha256-Y/YBjV+c5Gw1wMR5r/4VnyV/ewUVG0z4pjY/MB4ca9Y="; - }) - ]; - postPatch = '' substituteInPlace setup.py \ - --replace "==" ">=" + --replace-fail "==" ">=" + substituteInPlace dj_rest_auth/tests/test_api.py \ + --replace-fail "assertEquals" "assertEqual" ''; - nativeBuildInputs = [ + build-system = [ setuptools ]; @@ -49,7 +41,7 @@ buildPythonPackage rec { django ]; - propagatedBuildInputs = [ + dependencies = [ djangorestframework ]; @@ -66,7 +58,7 @@ buildPythonPackage rec { preCheck = '' # Test connects to graph.facebook.com substituteInPlace dj_rest_auth/tests/test_serializers.py \ - --replace "def test_http_error" "def dont_test_http_error" + --replace-fail "def test_http_error" "def dont_test_http_error" ''; checkPhase = '' From f3bf21db324845079a6d415c144efd8ebf4045b6 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 13 May 2024 10:00:03 +0200 Subject: [PATCH 3/7] python312Packages.unittest-xml-reporting: format with nixfmt --- .../unittest-xml-reporting/default.nix | 43 ++++++++----------- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/pkgs/development/python-modules/unittest-xml-reporting/default.nix b/pkgs/development/python-modules/unittest-xml-reporting/default.nix index 154c1885d051..030ab4337ec7 100644 --- a/pkgs/development/python-modules/unittest-xml-reporting/default.nix +++ b/pkgs/development/python-modules/unittest-xml-reporting/default.nix @@ -1,11 +1,12 @@ -{ lib -, buildPythonPackage -, fetchFromGitHub -, lxml -, pytestCheckHook -, pythonAtLeast -, pythonOlder -, setuptools +{ + lib, + buildPythonPackage, + fetchFromGitHub, + lxml, + pytestCheckHook, + pythonAtLeast, + pythonOlder, + setuptools, }: buildPythonPackage rec { @@ -22,25 +23,19 @@ buildPythonPackage rec { hash = "sha256-lOJ/+8CVJUXdIaZLLF5PpPkG0DzlNgo46kRZ1Xy7Ju0="; }; - build-system = [ - setuptools - ]; + build-system = [ setuptools ]; - dependencies = [ - lxml - ]; + dependencies = [ lxml ]; - nativeCheckInputs = [ - pytestCheckHook - ]; + nativeCheckInputs = [ pytestCheckHook ]; - disabledTests = lib.optionals (pythonAtLeast "3.11") [ - # AttributeError: 'tuple' object has no attribute 'shortDescription' - "test_basic_unittest_constructs" - "test_unexpected_success" - ] ++ lib.optionals (pythonAtLeast "3.12") [ - "test_xmlrunner_hold_traceback" - ]; + disabledTests = + lib.optionals (pythonAtLeast "3.11") [ + # AttributeError: 'tuple' object has no attribute 'shortDescription' + "test_basic_unittest_constructs" + "test_unexpected_success" + ] + ++ lib.optionals (pythonAtLeast "3.12") [ "test_xmlrunner_hold_traceback" ]; pythonImportsCheck = [ "xmlrunner" ]; From 5c1d3a46c851fe567111b6c1eff3a4b95884be89 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 13 May 2024 10:00:44 +0200 Subject: [PATCH 4/7] python312Packages.dj-rest-auth: format with nixfmt --- .../python-modules/dj-rest-auth/default.nix | 45 ++++++++----------- 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/pkgs/development/python-modules/dj-rest-auth/default.nix b/pkgs/development/python-modules/dj-rest-auth/default.nix index 63575b278b6b..49e0c49e75bb 100644 --- a/pkgs/development/python-modules/dj-rest-auth/default.nix +++ b/pkgs/development/python-modules/dj-rest-auth/default.nix @@ -1,15 +1,16 @@ -{ lib -, buildPythonPackage -, django -, django-allauth -, djangorestframework -, djangorestframework-simplejwt -, fetchFromGitHub -, python -, pythonOlder -, responses -, setuptools -, unittest-xml-reporting +{ + lib, + buildPythonPackage, + django, + django-allauth, + djangorestframework, + djangorestframework-simplejwt, + fetchFromGitHub, + python, + pythonOlder, + responses, + setuptools, + unittest-xml-reporting, }: buildPythonPackage rec { @@ -33,21 +34,13 @@ buildPythonPackage rec { --replace-fail "assertEquals" "assertEqual" ''; - build-system = [ - setuptools - ]; + build-system = [ setuptools ]; - buildInputs = [ - django - ]; + buildInputs = [ django ]; - dependencies = [ - djangorestframework - ]; + dependencies = [ djangorestframework ]; - passthru.optional-dependencies.with_social = [ - django-allauth - ]; + passthru.optional-dependencies.with_social = [ django-allauth ]; nativeCheckInputs = [ djangorestframework-simplejwt @@ -67,9 +60,7 @@ buildPythonPackage rec { runHook postCheck ''; - pythonImportsCheck = [ - "dj_rest_auth" - ]; + pythonImportsCheck = [ "dj_rest_auth" ]; meta = with lib; { description = "Authentication for Django Rest Framework"; From b74bbe882117ec3e5cec8adaa3a8d0403bc3f94c Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 13 May 2024 10:01:49 +0200 Subject: [PATCH 5/7] python312Packages.drf-spectacular: refactor --- .../drf-spectacular/default.nix | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/drf-spectacular/default.nix b/pkgs/development/python-modules/drf-spectacular/default.nix index f38a2fbf86bc..bc54ba30b98d 100644 --- a/pkgs/development/python-modules/drf-spectacular/default.nix +++ b/pkgs/development/python-modules/drf-spectacular/default.nix @@ -1,7 +1,5 @@ { lib , buildPythonPackage -, fetchFromGitHub -, fetchpatch , dj-rest-auth , django , django-allauth @@ -18,19 +16,25 @@ , drf-jwt , drf-nested-routers , drf-spectacular-sidecar +, fetchFromGitHub +, fetchpatch , inflection , jsonschema , psycopg2 , pytest-django , pytestCheckHook +, pythonOlder , pyyaml +, setuptools , uritemplate }: buildPythonPackage rec { pname = "drf-spectacular"; version = "0.27.1"; - format = "setuptools"; + pyproject = true; + + disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "tfranzel"; @@ -47,7 +51,11 @@ buildPythonPackage rec { }) ]; - propagatedBuildInputs = [ + build-system = [ + setuptools + ]; + + dependencies = [ django djangorestframework inflection @@ -77,9 +85,9 @@ buildPythonPackage rec { ]; disabledTests = [ - # requires django with gdal + # Test requires django with gdal "test_rest_framework_gis" - # outdated test artifact + # Outdated test artifact "test_pydantic_decoration" ]; From 9dae30d67f2800c5e3b155219f51a5d389bc8b86 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 13 May 2024 10:03:10 +0200 Subject: [PATCH 6/7] python312Packages.drf-spectacular: 0.27.1 -> 0.27.2 Changelog: https://github.com/tfranzel/drf-spectacular/releases/tag/0.27.2 --- pkgs/development/python-modules/drf-spectacular/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/drf-spectacular/default.nix b/pkgs/development/python-modules/drf-spectacular/default.nix index bc54ba30b98d..b842d225791c 100644 --- a/pkgs/development/python-modules/drf-spectacular/default.nix +++ b/pkgs/development/python-modules/drf-spectacular/default.nix @@ -31,7 +31,7 @@ buildPythonPackage rec { pname = "drf-spectacular"; - version = "0.27.1"; + version = "0.27.2"; pyproject = true; disabled = pythonOlder "3.7"; @@ -40,7 +40,7 @@ buildPythonPackage rec { owner = "tfranzel"; repo = "drf-spectacular"; rev = "refs/tags/${version}"; - hash = "sha256-R6rxEo9SNNziXRWB+01UUInParpGcFDIkDZtN4k+dFE="; + hash = "sha256-lOgFDkAY+PqSeyLSvWFT7KPVicSJZxd6yl17GAGHbRs="; }; patches = [ @@ -89,6 +89,7 @@ buildPythonPackage rec { "test_rest_framework_gis" # Outdated test artifact "test_pydantic_decoration" + "test_knox_auth_token" ]; pythonImportsCheck = [ "drf_spectacular" ]; From a966d523d947976e9e3975e56420fa2b251875f2 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 13 May 2024 10:03:32 +0200 Subject: [PATCH 7/7] python312Packages.drf-spectacular: format with nixfmt --- .../drf-spectacular/default.nix | 63 +++++++++---------- 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/pkgs/development/python-modules/drf-spectacular/default.nix b/pkgs/development/python-modules/drf-spectacular/default.nix index b842d225791c..9b957b53d4a0 100644 --- a/pkgs/development/python-modules/drf-spectacular/default.nix +++ b/pkgs/development/python-modules/drf-spectacular/default.nix @@ -1,32 +1,33 @@ -{ lib -, buildPythonPackage -, dj-rest-auth -, django -, django-allauth -, django-filter -, django-oauth-toolkit -, django-polymorphic -, django-rest-auth -, django-rest-polymorphic -, djangorestframework -, djangorestframework-camel-case -, djangorestframework-dataclasses -, djangorestframework-recursive -, djangorestframework-simplejwt -, drf-jwt -, drf-nested-routers -, drf-spectacular-sidecar -, fetchFromGitHub -, fetchpatch -, inflection -, jsonschema -, psycopg2 -, pytest-django -, pytestCheckHook -, pythonOlder -, pyyaml -, setuptools -, uritemplate +{ + lib, + buildPythonPackage, + dj-rest-auth, + django, + django-allauth, + django-filter, + django-oauth-toolkit, + django-polymorphic, + django-rest-auth, + django-rest-polymorphic, + djangorestframework, + djangorestframework-camel-case, + djangorestframework-dataclasses, + djangorestframework-recursive, + djangorestframework-simplejwt, + drf-jwt, + drf-nested-routers, + drf-spectacular-sidecar, + fetchFromGitHub, + fetchpatch, + inflection, + jsonschema, + psycopg2, + pytest-django, + pytestCheckHook, + pythonOlder, + pyyaml, + setuptools, + uritemplate, }: buildPythonPackage rec { @@ -51,9 +52,7 @@ buildPythonPackage rec { }) ]; - build-system = [ - setuptools - ]; + build-system = [ setuptools ]; dependencies = [ django