Skip to content

Commit 0a2f22d

Browse files
committed
Ignore local version identifiers in constraints.
Torch is frequently installed with a local version identifier (e.g. `+cu126`), but that identifier causes an issue with pip because there is no public package with that identifier unless an explicit alternative index is used. Stripping the local version identifier should be safe, as we are only using constraints to ensure that per-model dependencies are aligned with existing installations.
1 parent f144fe9 commit 0a2f22d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

utils/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def get_pkg_versions(packages: List[str]) -> Dict[str, str]:
2626
for module in packages:
2727
cmd = [sys.executable, "-c", f"import {module}; print({module}.__version__)"]
2828
version = subprocess.check_output(cmd).decode().strip()
29+
version = version.split('+')[0] # Remove any local version identifiers
2930
versions[module] = version
3031
return versions
3132

0 commit comments

Comments
 (0)