diff --git a/pkgs/development/python-modules/asn1/2.nix b/pkgs/development/python-modules/asn1/2.nix new file mode 100644 index 0000000000000..d2591c4f9a06e --- /dev/null +++ b/pkgs/development/python-modules/asn1/2.nix @@ -0,0 +1,42 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pytestCheckHook, + setuptools, +}: + +buildPythonPackage rec { + pname = "asn1"; + version = "2.8.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "andrivet"; + repo = "python-asn1"; + tag = "v${version}"; + hash = "sha256-DLKfdQzYLhfaIEPPymTzRqj3+L/fsm5Jh8kqud/ezfw="; + }; + + build-system = [ setuptools ]; + + pythonRemoveDeps = [ "enum-compat" ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + enabledTestPaths = [ "tests/test_asn1.py" ]; + + pythonImportsCheck = [ "asn1" ]; + + meta = { + description = "Python ASN.1 encoder and decoder"; + longDescription = '' + Kept for consumers that cannot use asn1 3.x, where Decoder.read() returns + recursively decoded values for constructed tags instead of the raw contents. + ''; + homepage = "https://github.com/andrivet/python-asn1"; + changelog = "https://github.com/andrivet/python-asn1/blob/${src.tag}/CHANGELOG.rst"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/pyimg4/default.nix b/pkgs/development/python-modules/pyimg4/default.nix index 2afacff46928f..6ace5ef027e5c 100644 --- a/pkgs/development/python-modules/pyimg4/default.nix +++ b/pkgs/development/python-modules/pyimg4/default.nix @@ -1,6 +1,6 @@ { apple-compress, - asn1, + asn1_2, buildPythonPackage, click, fetchFromGitHub, @@ -37,7 +37,8 @@ buildPythonPackage rec { ]; dependencies = [ - asn1 + # upstream pins asn1<3.0.0: https://github.com/m1stadev/PyIMG4/pull/59 + asn1_2 click pycryptodome pylzss @@ -66,8 +67,6 @@ buildPythonPackage rec { ]; meta = { - # https://github.com/m1stadev/PyIMG4/pull/59 - broken = lib.versionAtLeast asn1.version "3"; changelog = "https://github.com/m1stadev/PyIMG4/releases/tag/${src.tag}"; description = "Python library/CLI tool for parsing Apple's Image4 format"; homepage = "https://github.com/m1stadev/PyIMG4"; diff --git a/pkgs/development/python-modules/smart-meter-texas/default.nix b/pkgs/development/python-modules/smart-meter-texas/default.nix index 623ac30c6a81f..d2551a350cec8 100644 --- a/pkgs/development/python-modules/smart-meter-texas/default.nix +++ b/pkgs/development/python-modules/smart-meter-texas/default.nix @@ -3,7 +3,7 @@ buildPythonPackage, fetchFromGitHub, aiohttp, - asn1, + asn1_2, python-dateutil, setuptools, tenacity, @@ -30,7 +30,9 @@ buildPythonPackage rec { dependencies = [ aiohttp - asn1 + # _find_ca_issuers_uri() recurses with enter()/leave() and loops on eof(), + # which is only container-relative in asn1 2.x + asn1_2 python-dateutil tenacity ]; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 268e12aa78c09..6420255f810e8 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1399,6 +1399,8 @@ self: super: with self; { asn1 = callPackage ../development/python-modules/asn1 { }; + asn1_2 = callPackage ../development/python-modules/asn1/2.nix { }; + asn1ate = callPackage ../development/python-modules/asn1ate { }; asn1crypto = callPackage ../development/python-modules/asn1crypto { };