From a931ae023f4b784113ad0914b7d7c451317b9d54 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 36ce389de50f89..e620a17a5d7b7f 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}"