Skip to content

Commit

Permalink
Better venv debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
nbolton committed Sep 26, 2024
1 parent 0c92f64 commit beb17df
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/lib/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ def add_deskflow_path(script):


def ensure_in_venv(script):
if not in_venv():
if in_venv():
print(f"Running in venv, executable: {sys.executable}", flush=True)
else:
print(f"Using virtual environment for: {script}", flush=True)
run_in_venv(script)


def run_in_venv(script):
print("Re-running in virtual environment...")
venv.create(VENV_DIR, with_pip=True)
result = subprocess.run([get_python_executable(), script] + sys.argv[1:])
sys.exit(result.returncode)
Expand Down

0 comments on commit beb17df

Please sign in to comment.