From 20a1bd7475d9747788968fe5697a851fa18647d4 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 28 Oct 2024 22:04:57 +0100 Subject: [PATCH] python3.pkgs.pythonRuntimeDepsCheckHook: allow prereleases Updating to prereleases should be possible, but making this an option is difficult, given that for packages with many consumers you would have to set it in each consumer. We thoroughly test the package set, so allowing prereleases unconditionally shouldn't be too bad. Closes: #301698 --- .../python/hooks/python-runtime-deps-check-hook.py | 3 +++ 1 file changed, 3 insertions(+) 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 36ce389de50f8..e620a17a5d7b7 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,6 +78,9 @@ def test_requirement(requirement: Requirement) -> bool: error(f"{package_name} not installed") return False + # Allow prereleases, to give to give us some wiggle-room + requirement.specifier.prereleases = True + if requirement.specifier and package.version not in requirement.specifier: error( f"{package_name}{requirement.specifier} not satisfied by version {package.version}"