From 53ce34c53a54a00cb0b8e462e8aef6c8aec78140 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 22 Oct 2023 17:42:51 +0200 Subject: [PATCH] python311Packages.python-jose: expose extras refactor, add changelog reference. --- .../python-modules/python-jose/default.nix | 58 ++++++++++++++----- 1 file changed, 42 insertions(+), 16 deletions(-) diff --git a/pkgs/development/python-modules/python-jose/default.nix b/pkgs/development/python-modules/python-jose/default.nix index 68150935da96..6e3f406fe5a3 100644 --- a/pkgs/development/python-modules/python-jose/default.nix +++ b/pkgs/development/python-modules/python-jose/default.nix @@ -1,18 +1,28 @@ { lib , buildPythonPackage , fetchFromGitHub + +# build-system +, setuptools + +# dependencies , ecdsa , rsa -, pycrypto , pyasn1 -, pycryptodome + +# optional-dependencies , cryptography +, pycrypto +, pycryptodome + +# tests , pytestCheckHook }: buildPythonPackage rec { pname = "python-jose"; version = "3.3.0"; + pyproject = true; src = fetchFromGitHub { owner = "mpdavis"; @@ -21,27 +31,43 @@ buildPythonPackage rec { hash = "sha256-6VGC6M5oyGCOiXcYp6mpyhL+JlcYZKIqOQU9Sm/TkKM="; }; - propagatedBuildInputs = [ - cryptography - ecdsa - pyasn1 - pycrypto - pycryptodome - rsa - ]; - - nativeCheckInputs = [ - pytestCheckHook - ]; - postPatch = '' substituteInPlace setup.py \ --replace '"pytest-runner",' "" ''; - pythonImportsCheck = [ "jose" ]; + nativeBuildInputs = [ + setuptools + ]; + + propagatedBuildInputs = [ + ecdsa + pyasn1 + rsa + ]; + + passthru.optional-dependencies = { + cryptography = [ + cryptography + ]; + pycrypto = [ + pycrypto + ]; + pycryptodome = [ + pycryptodome + ]; + }; + + pythonImportsCheck = [ + "jose" + ]; + + nativeCheckInputs = [ + pytestCheckHook + ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies); meta = with lib; { + changelog = "https://github.com/mpdavis/python-jose/releases/tag/${version}"; homepage = "https://github.com/mpdavis/python-jose"; description = "A JOSE implementation in Python"; license = licenses.mit;