From f0721b5dd0e1c9a15d46e6a000ea18f936773972 Mon Sep 17 00:00:00 2001 From: Pedro Brochado Date: Mon, 7 Jul 2025 09:34:10 -0300 Subject: [PATCH] Skip scoped requirements on upperbound calculation The script does not know about the environment (os, python version, ...). --- templates/github/.ci/scripts/calc_constraints.py.j2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/github/.ci/scripts/calc_constraints.py.j2 b/templates/github/.ci/scripts/calc_constraints.py.j2 index c7e72d48..b271d359 100644 --- a/templates/github/.ci/scripts/calc_constraints.py.j2 +++ b/templates/github/.ci/scripts/calc_constraints.py.j2 @@ -48,6 +48,9 @@ def to_upper_bound(req): if requirement.name == "pulpcore": # An exception to allow for pulpcore deprecation policy. return fetch_pulpcore_upper_bound(requirement) + # skip requirement with environment scopes. E.g 'foo==1.0.0;python_version>=3.9' + if requirement.marker: + return f"# ENVIRONMENT IS UNTRACKABLE: {req}" for spec in requirement.specifier: if spec.operator == "~=": return f"# NO BETTER CONSTRAINT: {req}"