2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2022-12-17 10:02:37 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, poetry-core
|
2020-04-24 23:36:52 +00:00
|
|
|
, pyasn1
|
2022-12-17 10:02:37 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, pythonOlder
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "rsa";
|
2022-09-30 11:47:45 +00:00
|
|
|
version = "4.9";
|
2022-12-17 10:02:37 +00:00
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sybrenstuvel";
|
|
|
|
repo = "python-rsa";
|
|
|
|
rev = "version-${version}";
|
|
|
|
hash = "sha256-PwaRe+ICy0UoguXSMSh3PFl5R+YAhJwNdNN9isadlJY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
preConfigure = lib.optionalString (pythonOlder "3.7") ''
|
|
|
|
substituteInPlace setup.py --replace "open('README.md')" "open('README.md',encoding='utf-8')"
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [ pyasn1 ];
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
preCheck = ''
|
|
|
|
sed -i '/addopts/d' tox.ini
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
"tests/test_mypy.py"
|
|
|
|
];
|
2020-06-15 15:56:04 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://stuvel.eu/rsa";
|
|
|
|
license = licenses.asl20;
|
|
|
|
description = "A pure-Python RSA implementation";
|
|
|
|
};
|
|
|
|
}
|