Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions salt/modules/pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -1696,11 +1696,18 @@ def list_all_versions(
for line in result["stdout"].splitlines():
match = regex.search(line)
if match:
versions = [
v for v in match.group(1).split(", ") if v and excludes.match(v)
]
versions.sort(key=pkg_resources.parse_version)
break
versions = []
for v in match.group(1).split(", "):
if v and excludes.match(v):
try:
pkg_resources.parse_version(v)

except pkg_resources.extern.packaging.version.InvalidVersion as e:
logger.info(f"{e} for package {pkg}, skipping this version...")
continue

versions.append(v)

if not versions:
return None

Expand Down