mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 02:48:17 +00:00
Configurable bootstrap dir (#1772)
Add a `UV_BOOTSTRAP_DIR` option to configure the python bootstrap directory. This is helpful when working across multiple platforms in a single IDE session.
This commit is contained in:
parent
5d53040465
commit
0f520d8716
3 changed files with 24 additions and 6 deletions
|
@ -30,6 +30,7 @@
|
|||
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import platform
|
||||
import shutil
|
||||
import sys
|
||||
|
@ -48,7 +49,10 @@ except ImportError:
|
|||
# Setup some file paths
|
||||
THIS_DIR = Path(__file__).parent
|
||||
ROOT_DIR = THIS_DIR.parent.parent
|
||||
BIN_DIR = ROOT_DIR / "bin"
|
||||
if bin_dir := os.environ.get("UV_BOOTSTRAP_DIR"):
|
||||
BIN_DIR = Path(bin_dir)
|
||||
else:
|
||||
BIN_DIR = ROOT_DIR / "bin"
|
||||
INSTALL_DIR = BIN_DIR / "versions"
|
||||
VERSIONS_FILE = ROOT_DIR / ".python-versions"
|
||||
VERSIONS_METADATA_FILE = THIS_DIR / "versions.json"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue