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

fix: check existing venv before creating venv #64

Open
JaeAeich opened this issue Jan 15, 2025 · 2 comments
Open

fix: check existing venv before creating venv #64

JaeAeich opened this issue Jan 15, 2025 · 2 comments
Labels
flag: good 1st issue Good for newcomers

Comments

@JaeAeich
Copy link
Collaborator

update .devcontainer.json:

  "postCreateCommand": "[ -d .venv ] && rm -rf .venv; make venv && . .venv/bin/activate && make install",
@JaeAeich JaeAeich added the flag: good 1st issue Good for newcomers label Jan 21, 2025
@YoussefMoRabie
Copy link

Hi @JaeAeich 👋

I noticed the postCreateCommand in your solution always deletes the existing .venv and creates a new one, which will result in reinstalling dependencies every time. This could slow down the setup process unnecessarily.

I recommend using this alternative approach:

"postCreateCommand": "[ -d .venv ] || make venv && . .venv/bin/activate && make install"

This checks if the .venv directory already exists and reuses it if available. If it doesn’t exist, it will create the virtual environment and install dependencies.

This way, we avoid recreating the virtual environment every time, which should help save time, especially when dependencies are already in place. What do you think?

@JaeAeich
Copy link
Collaborator Author

JaeAeich commented Feb 7, 2025

sure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flag: good 1st issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants