nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix

python310Packages.rsa: update and fix tests

+29 -14
+29 -14
pkgs/development/python-modules/rsa/default.nix
··· 1 1 { lib 2 2 , buildPythonPackage 3 - , fetchPypi 4 - , unittest2 3 + , fetchFromGitHub 4 + , poetry-core 5 5 , pyasn1 6 - , mock 7 - , isPy3k 6 + , pytestCheckHook 8 7 , pythonOlder 9 8 }: 10 9 11 10 buildPythonPackage rec { 12 11 pname = "rsa"; 13 12 version = "4.9"; 13 + format = "pyproject"; 14 14 15 - src = fetchPypi { 16 - inherit pname version; 17 - sha256 = "sha256-44RkpJxshdfxNRsBJmYUh6fgoUpQ8WdexQ6zTU8g7yE="; 15 + disabled = pythonOlder "3.6"; 16 + 17 + src = fetchFromGitHub { 18 + owner = "sybrenstuvel"; 19 + repo = "python-rsa"; 20 + rev = "version-${version}"; 21 + hash = "sha256-PwaRe+ICy0UoguXSMSh3PFl5R+YAhJwNdNN9isadlJY="; 18 22 }; 19 23 20 - checkInputs = [ unittest2 mock ]; 21 - propagatedBuildInputs = [ pyasn1 ]; 22 - 23 - preConfigure = lib.optionalString (isPy3k && pythonOlder "3.7") '' 24 + preConfigure = lib.optionalString (pythonOlder "3.7") '' 24 25 substituteInPlace setup.py --replace "open('README.md')" "open('README.md',encoding='utf-8')" 25 26 ''; 26 27 27 - # No tests in archive 28 - doCheck = false; 28 + nativeBuildInputs = [ 29 + poetry-core 30 + ]; 31 + 32 + propagatedBuildInputs = [ pyasn1 ]; 33 + 34 + preCheck = '' 35 + sed -i '/addopts/d' tox.ini 36 + ''; 37 + 38 + checkInputs = [ 39 + pytestCheckHook 40 + ]; 41 + 42 + disabledTestPaths = [ 43 + "tests/test_mypy.py" 44 + ]; 29 45 30 46 meta = with lib; { 31 47 homepage = "https://stuvel.eu/rsa"; 32 48 license = licenses.asl20; 33 49 description = "A pure-Python RSA implementation"; 34 50 }; 35 - 36 51 }