From ec7062492f88984017da132aa28167d0a5d3a456 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 25 Dec 2021 20:38:14 +0100 Subject: [PATCH 1/5] python3Packages.pydub: clean up and adopt --- .../python-modules/pydub/default.nix | 37 ++++++++++++------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/pkgs/development/python-modules/pydub/default.nix b/pkgs/development/python-modules/pydub/default.nix index 6b67814a2220..3adf54281b77 100644 --- a/pkgs/development/python-modules/pydub/default.nix +++ b/pkgs/development/python-modules/pydub/default.nix @@ -1,8 +1,18 @@ -{ lib, stdenv, buildPythonPackage, fetchFromGitHub, scipy, ffmpeg-full }: +{ lib +, stdenv +, buildPythonPackage +, fetchFromGitHub + +# tests +, ffmpeg-full +, python +}: buildPythonPackage rec { pname = "pydub"; version = "0.25.1"; + format = "setuptools"; + # pypi version doesn't include required data files for tests src = fetchFromGitHub { owner = "jiaaro"; @@ -11,23 +21,24 @@ buildPythonPackage rec { sha256 = "0xskllq66wqndjfmvp58k26cv3w480sqsil6ifwp4gghir7hqc8m"; }; + pythonImportsCheck = [ + "pydub" + "pydub.audio_segment" + "pydub.playback" + ]; - # disable a test that fails on aarch64 due to rounding errors - postPatch = lib.optionalString stdenv.isAarch64 '' - substituteInPlace test/test.py \ - --replace "test_overlay_with_gain_change" "notest_overlay_with_gain_change" - ''; - - checkInputs = [ scipy ffmpeg-full ]; + checkInputs = [ + ffmpeg-full + ]; checkPhase = '' - python test/test.py + ${python.interpreter} test/test.py ''; meta = with lib; { - description = "Manipulate audio with a simple and easy high level interface."; - homepage = "http://pydub.com/"; - license = licenses.mit; - platforms = platforms.all; + description = "Manipulate audio with a simple and easy high level interface"; + homepage = "http://pydub.com"; + license = licenses.mit; + maintainers = with maintainers; [ hexa ]; }; } From c57eccc31a60e0b7eeb5f03be45b37fffba9b6e2 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 25 Dec 2021 21:25:00 +0100 Subject: [PATCH 2/5] python3Packages.django-allauth: 0.40.0 -> 0.47.0 --- pkgs/development/python-modules/django-allauth/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/django-allauth/default.nix b/pkgs/development/python-modules/django-allauth/default.nix index 143e76cf0d87..a68cfd6d9cdf 100644 --- a/pkgs/development/python-modules/django-allauth/default.nix +++ b/pkgs/development/python-modules/django-allauth/default.nix @@ -3,14 +3,14 @@ buildPythonPackage rec { pname = "django-allauth"; - version = "0.40.0"; + version = "0.47.0"; # no tests on PyPI src = fetchFromGitHub { owner = "pennersr"; repo = pname; rev = version; - sha256 = "10id4k01p1hg5agb8cmllg8mv4kc7ryl75br10idwxabqqp4vla1"; + sha256 = "sha256-wKrsute6TCl331UrxNEBf/zTtGnyGHsOZQwdiicbg2o="; }; propagatedBuildInputs = [ requests requests_oauthlib django python3-openid ]; From 5274779f1927cb869653ad987f0c24652bc5f84a Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 25 Dec 2021 21:27:05 +0100 Subject: [PATCH 3/5] python3Packages.oauthlib: 2020-05-08 -> 3.1.1 --- .../python-modules/oauthlib/default.nix | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/oauthlib/default.nix b/pkgs/development/python-modules/oauthlib/default.nix index 5c4cbc78adb7..01e6ca29b5d9 100644 --- a/pkgs/development/python-modules/oauthlib/default.nix +++ b/pkgs/development/python-modules/oauthlib/default.nix @@ -1,31 +1,40 @@ { lib , buildPythonPackage , fetchFromGitHub -, mock -, pytest -, cryptography + +# propagates , blinker +, cryptography , pyjwt + +# test +, mock +, pytestCheckHook }: buildPythonPackage rec { pname = "oauthlib"; - version = "unstable-2020-05-08"; + version = "3.1.1"; + format = "setuptools"; # master supports pyjwt==1.7.1 src = fetchFromGitHub { owner = pname; repo = pname; - rev = "46647402896db5f0d979eba9594623e889739060"; - sha256 = "1wrdjdvlfcd74lckcgascnasrffg8sip0z673si4ag5kv4afiz3l"; + rev = "v${version}"; + hash = "sha256:1bgxpzh11i0x7h9py3a29cz5z714b3p498b62znnn5ciy0cr80sv"; }; - checkInputs = [ mock pytest ]; - propagatedBuildInputs = [ cryptography blinker pyjwt ]; + propagatedBuildInputs = [ + blinker + cryptography + pyjwt + ]; - checkPhase = '' - py.test tests/ - ''; + checkInputs = [ + mock + pytestCheckHook + ]; meta = with lib; { homepage = "https://github.com/idan/oauthlib"; From 31f20a69d95d010261534fe22bc233e924e83d71 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 25 Dec 2021 21:53:06 +0100 Subject: [PATCH 4/5] python3Packages.django-oauth-toolkit: 1.2.0 -> 1.6.1 Update the package and enable tests. --- .../django-oauth-toolkit/default.nix | 50 ++++++++++++++++--- 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/django-oauth-toolkit/default.nix b/pkgs/development/python-modules/django-oauth-toolkit/default.nix index e7cb4814cb48..6212c754f893 100644 --- a/pkgs/development/python-modules/django-oauth-toolkit/default.nix +++ b/pkgs/development/python-modules/django-oauth-toolkit/default.nix @@ -1,22 +1,58 @@ -{ lib, buildPythonPackage, fetchFromGitHub -, django, requests, oauthlib +{ lib +, buildPythonPackage +, fetchFromGitHub + +# propagates +, django +, jwcrypto +, requests +, oauthlib + +# tests +, djangorestframework +, pytest-django +, pytest-xdist +, pytest-mock +, pytestCheckHook }: buildPythonPackage rec { pname = "django-oauth-toolkit"; - version = "1.2.0"; + version = "1.6.1"; + format = "setuptools"; src = fetchFromGitHub { owner = "jazzband"; repo = pname; rev = version; - sha256 = "1zbksxrcxlqnapmlvx4rgvpqc4plgnq0xnf45cjwzwi1626zs8g6"; + sha256 = "sha256-TOrFxQULwiuwpVFqRwRkfTW+GRudLNy6F/gIjUYjZhI="; }; - propagatedBuildInputs = [ django requests oauthlib ]; + postPatch = '' + sed -i '/cov/d' tox.ini + ''; - # django.core.exceptions.ImproperlyConfigured: Requested setting OAUTH2_PROVIDER, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings - doCheck = false; + propagatedBuildInputs = [ + django + jwcrypto + oauthlib + requests + ]; + + DJANGO_SETTINGS_MODULE = "tests.settings"; + + checkInputs = [ + djangorestframework + pytest-django + pytest-xdist + pytest-mock + pytestCheckHook + ]; + + disabledTests = [ + # Failed to get a valid response from authentication server. Status code: 404, Reason: Not Found. + "test_response_when_auth_server_response_return_404" + ]; meta = with lib; { description = "OAuth2 goodies for the Djangonauts"; From 37ec5df9460dfcb5415aa9deb086b99a7a957cd0 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 26 Dec 2021 01:32:15 +0100 Subject: [PATCH 5/5] python3Packages.django-environ: rename from django_environ --- pkgs/development/python-modules/django_guardian/default.nix | 4 ++-- pkgs/top-level/python-aliases.nix | 1 + pkgs/top-level/python-packages.nix | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/django_guardian/default.nix b/pkgs/development/python-modules/django_guardian/default.nix index 9685e55bb1c3..c7bda13dd9ab 100644 --- a/pkgs/development/python-modules/django_guardian/default.nix +++ b/pkgs/development/python-modules/django_guardian/default.nix @@ -1,5 +1,5 @@ { lib, buildPythonPackage, fetchPypi -, django_environ, mock, django +, django-environ, mock, django , pytest, pytest-runner, pytest-django }: buildPythonPackage rec { @@ -11,7 +11,7 @@ buildPythonPackage rec { sha256 = "c58a68ae76922d33e6bdc0e69af1892097838de56e93e78a8361090bcd9f89a0"; }; - checkInputs = [ pytest pytest-runner pytest-django django_environ mock ]; + checkInputs = [ pytest pytest-runner pytest-django django-environ mock ]; propagatedBuildInputs = [ django ]; meta = with lib; { diff --git a/pkgs/top-level/python-aliases.nix b/pkgs/top-level/python-aliases.nix index f131cfcb06ee..1bccb391084a 100644 --- a/pkgs/top-level/python-aliases.nix +++ b/pkgs/top-level/python-aliases.nix @@ -44,6 +44,7 @@ mapAliases ({ diff_cover = diff-cover; # added 2021-07-02 discogs_client = discogs-client; # added 2021-07-02 djangorestframework-jwt = drf-jwt; # added 2021-07-20 + django_environ = django-environ; # added 2021-12-25 django_redis = django-redis; # added 2021-10-11 django_taggit = django-taggit; # added 2021-10-11 dns = dnspython; # added 2017-12-10 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 622dbecc206a..19a99ee4f690 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2202,7 +2202,7 @@ in { django-dynamic-preferences = callPackage ../development/python-modules/django-dynamic-preferences { }; - django_environ = callPackage ../development/python-modules/django_environ { }; + django-environ = callPackage ../development/python-modules/django_environ { }; django_extensions = callPackage ../development/python-modules/django-extensions { };