mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-22 05:14:59 +00:00
works
This commit is contained in:
parent
a376f91de6
commit
72f0686c66
1 changed files with 18 additions and 10 deletions
28
setup.py
28
setup.py
|
@ -1,4 +1,6 @@
|
||||||
import re
|
import re
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
from setuptools import find_packages, setup
|
from setuptools import find_packages, setup
|
||||||
|
|
||||||
|
@ -17,31 +19,37 @@ with open("README.md", "r", encoding="utf-8") as f:
|
||||||
packages = find_packages(exclude=["benchmark"]) + ["aider.website"]
|
packages = find_packages(exclude=["benchmark"]) + ["aider.website"]
|
||||||
print("Discovered packages:", packages)
|
print("Discovered packages:", packages)
|
||||||
|
|
||||||
import subprocess
|
torch = "torch==2.2.2"
|
||||||
|
|
||||||
|
|
||||||
cmd = [
|
cmd = [
|
||||||
|
sys.executable,
|
||||||
|
"-m",
|
||||||
"pip",
|
"pip",
|
||||||
"install",
|
"download",
|
||||||
"torch<2.2.2",
|
torch,
|
||||||
"--no-deps",
|
"--no-deps",
|
||||||
"--dry-run",
|
"--dest",
|
||||||
"--no-cache-dir",
|
"/dev/null",
|
||||||
|
# "--no-cache-dir",
|
||||||
|
# "--ignore-installed",
|
||||||
"--index-url",
|
"--index-url",
|
||||||
"https://download.pytorch.org/whl/cpu",
|
"https://download.pytorch.org/whl/cpu",
|
||||||
]
|
]
|
||||||
|
|
||||||
result = subprocess.check_output(cmd, text=True)
|
result = subprocess.check_output(cmd, text=True)
|
||||||
|
print(result)
|
||||||
|
|
||||||
url_match = re.search(r'(https://download\.pytorch\.org/[^\s]+)', result)
|
url_match = re.search(r"Downloading (https://download\.pytorch\.org/[^\s]+\.whl)", result)
|
||||||
if url_match:
|
if url_match:
|
||||||
pytorch_url = url_match.group(1)
|
pytorch_url = url_match.group(1)
|
||||||
print(f"PyTorch URL: {pytorch_url}")
|
print(f"PyTorch URL: {pytorch_url}")
|
||||||
|
requirements = [f"torch @ {pytorch_url}"] + requirements
|
||||||
else:
|
else:
|
||||||
print("PyTorch URL not found in the output")
|
print("PyTorch URL not found in the output")
|
||||||
|
requirements = [torch] + requirements
|
||||||
|
|
||||||
import sys
|
print(requirements)
|
||||||
sys.exit()
|
|
||||||
|
# sys.exit()
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="aider-chat",
|
name="aider-chat",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue