diff --git a/pkgs/development/python-modules/asn1/default.nix b/pkgs/development/python-modules/asn1/default.nix new file mode 100644 index 000000000000..7a83703f862c --- /dev/null +++ b/pkgs/development/python-modules/asn1/default.nix @@ -0,0 +1,45 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, future +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "asn1"; + version = "2.4.1"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "andrivet"; + repo = "python-asn1"; + rev = "v${version}"; + sha256 = "0g2d5cr1pxsm5ackba7padf7gvlgrgv807kh0312s5axjd2cww2l"; + }; + + propagatedBuildInputs = [ + future + ]; + + checkInputs = [ + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace setup.py \ + --replace "enum-compat" "" + ''; + + pytestFlagsArray = [ "tests/test_asn1.py" ]; + + pythonImportsCheck = [ "asn1" ]; + + meta = with lib; { + description = "Python ASN.1 encoder and decoder"; + homepage = "https://github.com/andrivet/python-asn1"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 7403b1ba4083..9311abfde349 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -565,6 +565,8 @@ in { asgiref = callPackage ../development/python-modules/asgiref { }; + asn1 = callPackage ../development/python-modules/asn1 { }; + asn1ate = callPackage ../development/python-modules/asn1ate { }; asn1crypto = callPackage ../development/python-modules/asn1crypto { };