Skip to content

Conversation

Lagoja
Copy link
Contributor

@Lagoja Lagoja commented Feb 7, 2023

Summary

This plugin automatically sets up a virtual environment for python packages whenever a python3 version of pip is added.

  • Sets a VENV_DIR environment variable that determines where the virtualenv is
  • A venvShellHook.sh file is added in devbox.d which creates the venv directory at $VENV_DIR if it doesn't already exist
  • The plugin's init hook runs the venvShellHook.sh script

I've left it so the user still needs to source the virtualenv manually, so they can choose whether or not to activate on starting devbox shell

How was it tested?

Tested in devbox-examples, create a simple requirements.txt and ran it with the plugin

@Lagoja Lagoja requested a review from mikeland73 February 7, 2023 21:33
@Lagoja
Copy link
Contributor Author

Lagoja commented Feb 7, 2023

Did this really quick because I got annoyed with setting up venv manually on Python examples

@Lagoja Lagoja requested review from savil and loreto February 7, 2023 21:37
@Lagoja Lagoja merged commit dee5576 into main Feb 7, 2023
@Lagoja Lagoja deleted the jl/pip-plugin branch February 7, 2023 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants