depot/third_party/nixpkgs/pkgs/development/python-modules/pysnmpcrypto/default.nix
Default email 5ca88bfbb9 Project import generated by Copybara.
GitOrigin-RevId: 9f918d616c5321ad374ae6cb5ea89c9e04bf3e58
2024-07-31 10:19:44 +00:00

52 lines
1.1 KiB
Nix

{
lib,
buildPythonPackage,
fetchPypi,
# build-system
setuptools,
# dependencies
cryptography,
pycryptodomex,
# tests
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "pysnmpcrypto";
version = "0.0.4";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-tjX7Ox7GY3uaADP1BQYhThbrhFdLHSWrAnu95MqlUSk=";
};
postPatch = ''
# ValueError: invalid literal for int() with base 10: 'post0' in File "<string>", line 104, in <listcomp>
substituteInPlace setup.py --replace \
"observed_version = [int(x) for x in setuptools.__version__.split('.')]" \
"observed_version = [36, 2, 0]"
'';
nativeBuildInputs = [ setuptools ];
propagatedBuildInputs = [
cryptography
pycryptodomex
];
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "pysnmpcrypto" ];
meta = with lib; {
description = "Strong crypto support for Python SNMP library";
homepage = "https://github.com/etingof/pysnmpcrypto";
changelog = "https://github.com/etingof/pysnmpcrypto/blob/${version}/CHANGES.txt";
license = licenses.bsd2;
maintainers = [ ];
};
}