Revert "pain"

This reverts commit ab1f48442d.
This commit is contained in:
Haoming
2025-12-10 21:47:57 +08:00
parent ab1f48442d
commit fe6cee8a43
2 changed files with 5 additions and 6 deletions
+4 -5
View File
@@ -91,11 +91,10 @@ def run(command, desc=None, errdesc=None, custom_env=None, live: bool = default_
def _torch_version() -> tuple[str, str]:
"""Given `2.10.0.dev20251111+cu130` ; Return `("2.10.0", "cu130")`"""
stdout: str = run("pip show torch")
for line in stdout.split("\n"):
if line.startswith("Version"):
m = re.search(r"(\d+\.\d+\.\d+)(?:[^+]+)?\+(.+)", line)
break
import importlib.metadata
ver = importlib.metadata.version("torch")
m = re.search(r"(\d+\.\d+\.\d+)(?:[^+]+)?\+(.+)", ver)
return m.group(1), m.group(2)
+1 -1
View File
@@ -28,7 +28,7 @@ def patch(symlink: bool):
assert isinstance(command, list)
if "pip" not in command or "install" not in command:
if "pip" not in command:
return subprocess.__original_run(*_original_args, **_original_kwargs)
cmd = command[command.index("pip") + 1 :]