Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support workdir venv #1548

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Support workdir venv #1548

wants to merge 2 commits into from

Conversation

nirs
Copy link
Member

@nirs nirs commented Sep 9, 2024

Support creating venv per workdir:

git worktree add ~/ramen-foobar
cd ~/ramen-foobar
hack/make-venv .venv/ramen
source venv

With this you can test drenv changes in the ramen-foobar worktree without affecting the main worktree, using the standard venv (~/.venv/ramen).

Use this in the CI to ensure that every build uses a fresh venv instead of installing drenv on the runner host.

@nirs nirs marked this pull request as draft September 19, 2024 14:28
@nirs
Copy link
Member Author

nirs commented Sep 19, 2024

Needs rebase after main changed.

@nirs nirs marked this pull request as ready for review September 19, 2024 17:47
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 <[email protected]>
Create venv inside the ramen checkout directory to have fresh venv for
every build.

Since drenv is not installed on the runner, we need to enter the venv in
any step script. I hope we can find a way to enter the venv once for the
entire job, but this is good enough for now.

Signed-off-by: Nir Soffer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants