Skip to content

Commit

Permalink
resolve issue with not discovering real dependencies (#37453)
Browse files Browse the repository at this point in the history
  • Loading branch information
scbedd authored Sep 19, 2024
1 parent 7f6bc29 commit adc02f1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions scripts/devops_tasks/common_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

# this assumes the presence of "packaging"
from packaging.specifiers import SpecifierSet
from packaging.version import Version
from packaging.version import parse

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

if spec:
versions = [str(v) for v in versions if str(v) in spec]
specifier = SpecifierSet(spec)
versions = [str(v) for v in versions if v in specifier]
except:
logging.error("Package {} is not found on PyPI".format(package_name))
return versions
Expand Down

0 comments on commit adc02f1

Please sign in to comment.