From bf79da53a0c5be337e2be6aa17d50a6636bb8581 Mon Sep 17 00:00:00 2001 From: Nir Soffer Date: Thu, 2 May 2024 00:38:38 +0300 Subject: [PATCH] Support custom venv directory When using CI, we want to use a fresh venv for every build so bad venv created by one job does not break the next job, or bad change in a PR is not hidden by good venv created by a previous job. When using local development, you may want to have venv per ramen source directory. One case is using git worktree to have multiple ramen trees. With this change you can create a venv per ramen worktree. Example usage: hack/make-venv .venv/ramen Since this is the expected usage, add this path to gitignore, so using `git clean dxf` does not remove the directory. Signed-off-by: Nir Soffer --- .gitignore | 1 + hack/make-venv | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 22e2f32f8..f4de2acb8 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ config/hub/bundle .zed # Generated files +.venv venv # Test enviromemnt generated files diff --git a/hack/make-venv b/hack/make-venv index a37ab78f7..3d0c07d6a 100755 --- a/hack/make-venv +++ b/hack/make-venv @@ -1,6 +1,6 @@ #!/bin/bash -e -venv=~/.venv/ramen +venv=${1:-~/.venv/ramen} if [ -d "$venv" ]; then echo "Virtual environemnt exists: '$venv'"