Skip to content

Commit adc02f1

Browse files
authored
resolve issue with not discovering real dependencies (Azure#37453)
1 parent 7f6bc29 commit adc02f1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

scripts/devops_tasks/common_tasks.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323

2424
# this assumes the presence of "packaging"
2525
from packaging.specifiers import SpecifierSet
26-
from packaging.version import Version
27-
from packaging.version import parse
2826

2927
from ci_tools.functions import MANAGEMENT_PACKAGE_IDENTIFIERS, NO_TESTS_ALLOWED, lambda_filter_azure_pkg, str_to_bool
3028
from ci_tools.parsing import parse_require, ParsedSetup
@@ -203,7 +201,8 @@ def is_required_version_on_pypi(package_name: str, spec: str) -> bool:
203201
versions = client.get_ordered_versions(package_name)
204202

205203
if spec:
206-
versions = [str(v) for v in versions if str(v) in spec]
204+
specifier = SpecifierSet(spec)
205+
versions = [str(v) for v in versions if v in specifier]
207206
except:
208207
logging.error("Package {} is not found on PyPI".format(package_name))
209208
return versions

0 commit comments

Comments
 (0)