|
18 | 18 |
|
19 | 19 | def main(): |
20 | 20 | """ |
21 | | - Installs extra dependencies specified in extra_deps.txt using uv. |
| 21 | + Installs extra dependencies specified in extra_deps_from_github.txt using uv. |
22 | 22 |
|
23 | | - This script looks for 'extra_deps.txt' relative to its own location. |
| 23 | + This script looks for 'extra_deps_from_github.txt' relative to its own location. |
24 | 24 | It executes 'uv pip install -r <path_to_extra_deps.txt> --resolution=lowest'. |
25 | 25 | """ |
26 | 26 | script_dir = Path(__file__).resolve().parent |
27 | 27 |
|
28 | | - # Adjust this path if your extra_deps.txt is in a different location, |
| 28 | + # Adjust this path if your extra_deps_from_github.txt is in a different location, |
29 | 29 | # e.g., script_dir / "data" / "extra_deps_from_github.txt" |
30 | 30 | extra_deps_file = script_dir / "extra_deps_from_github.txt" |
31 | 31 |
|
32 | 32 | if not extra_deps_file.exists(): |
33 | 33 | print(f"Error: '{extra_deps_file}' not found.") |
34 | | - print("Please ensure 'extra_deps.txt' is in the correct location relative to the script.") |
| 34 | + print("Please ensure 'extra_deps_from_github.txt' is in the correct location relative to the script.") |
35 | 35 | sys.exit(1) |
36 | | - # Check if 'uv' is available in the system's PATH |
| 36 | + # Check if 'uv' is available in the environment |
37 | 37 | try: |
38 | | - subprocess.run(["uv", "--version"], check=True, capture_output=True) |
39 | | - except FileNotFoundError: |
40 | | - print("Error: 'uv' command not found.") |
41 | | - subprocess.run(["pip", "install", "uv"], check=True) |
42 | | - subprocess.run(["uv", "--version"], check=True, capture_output=True) |
43 | | - sys.exit(1) |
| 38 | + subprocess.run([sys.executable, "-m", "pip", "install", "uv"], check=True, capture_output=True) |
| 39 | + subprocess.run([sys.executable, "-m", "uv", "--version"], check=True, capture_output=True) |
44 | 40 | except subprocess.CalledProcessError as e: |
45 | 41 | print(f"Error checking uv version: {e}") |
46 | 42 | print(f"Stderr: {e.stderr.decode()}") |
|
0 commit comments