From bcd6e799e0a53f8f85e1faf6676bfab20e02ca4d Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 22 Mar 2024 16:25:55 +0100 Subject: [PATCH 1/2] python3.pkgs.pythonRuntimeDepsCheckHook: skip empty specifiers Prevent the hook from erroring out on missing specifiers, as reported for `highspy`, which currently ships with a pre-release version, triggering the following error message: - highspy not satisfied by version 1.7.1.dev1 --- .../interpreters/python/hooks/python-runtime-deps-check-hook.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/python/hooks/python-runtime-deps-check-hook.py b/pkgs/development/interpreters/python/hooks/python-runtime-deps-check-hook.py index 5a3a91939175..11687e585121 100644 --- a/pkgs/development/interpreters/python/hooks/python-runtime-deps-check-hook.py +++ b/pkgs/development/interpreters/python/hooks/python-runtime-deps-check-hook.py @@ -78,7 +78,7 @@ def test_requirement(requirement: Requirement) -> bool: error(f"{package_name} not installed") return False - if package.version not in requirement.specifier: + if requirement.specifier and package.version not in requirement.specifier: error( f"{package_name}{requirement.specifier} not satisfied by version {package.version}" ) From 2c68d6b0298d430fdd0f498ec6b27b49193f8b1c Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 22 Mar 2024 16:33:37 +0100 Subject: [PATCH 2/2] python311Packages.packaging: 23.2 -> 24.0 https://github.com/pypa/packaging/blob/24.0/CHANGELOG.rst The `requires_dist` field now defaults to `None`, if the package does not specify any requirements. --- .../python/hooks/python-runtime-deps-check-hook.py | 7 ++++++- pkgs/development/python-modules/packaging/default.nix | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/development/interpreters/python/hooks/python-runtime-deps-check-hook.py b/pkgs/development/interpreters/python/hooks/python-runtime-deps-check-hook.py index 11687e585121..36ce389de50f 100644 --- a/pkgs/development/interpreters/python/hooks/python-runtime-deps-check-hook.py +++ b/pkgs/development/interpreters/python/hooks/python-runtime-deps-check-hook.py @@ -91,7 +91,12 @@ if __name__ == "__main__": args = argparser.parse_args() metadata = get_metadata(args.wheel) - tests = [test_requirement(requirement) for requirement in metadata.requires_dist] + requirements = metadata.requires_dist + + if not requirements: + sys.exit(0) + + tests = [test_requirement(requirement) for requirement in requirements] if not all(tests): sys.exit(1) diff --git a/pkgs/development/python-modules/packaging/default.nix b/pkgs/development/python-modules/packaging/default.nix index 123c1230fc87..32ce7fd8accb 100644 --- a/pkgs/development/python-modules/packaging/default.nix +++ b/pkgs/development/python-modules/packaging/default.nix @@ -14,14 +14,14 @@ let packaging = buildPythonPackage rec { pname = "packaging"; - version = "23.2"; + version = "24.0"; pyproject = true; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - hash = "sha256-BI+w6UBQNlGOqvSKVZU8dQwR4aG2jg3RqdYu0MCSz8U="; + hash = "sha256-64LF4+ViCQdHZuaIW7BLjDigwBXQowA26+fs40yZiek="; }; nativeBuildInputs = [