This EXPERIMENTAL extension is meant to help people set up a Python environment.
The project structure and user experience of this extension is very opinionated. While the supported project structures and workflows are considered common enough, do not be surprised if your particular workflow is not supported, especially if they would be considered advanced to someone new to Python.
This extension is meant act as a playground for the Python extension around environments and solicit feedback on this extension's functionality. If you have any feedback, please start a discussion. Popular functionality may make it's way into the Python extension itself.
If the VIRTUAL_ENV
environment variable is set, WWBD will use that to set the selected Python environment.
- Use an appropriate interpreter (the selected interpreter, ask the user to use the newest version of Python installed, or ask the user to pick an interpreter).
- Create a virtual environment in the workspace that git will ignore:
python -m venv .venv --prompt . && echo "*" > .venv/.gitignore
. - Find the most appropriate requirements file (file name contains
dev
andrequirements
and ends in.txt
, orrequirements.txt
). - Install the requirements into the environment:
python -m pip install --requirement <requirements file>
.
- Python (must be an actively maintained version; typically any version less than 5 years old)
-
venv
(typically only missing on Debian-based Linux distros; install viapython3-venv
) -
pip
(typically only missing on Debian-based Linux distros; install viapython3-pip
) - Python extension (which will be installed automatically)
N/A
- The selected Python interpreter must have
venv
andpip
available/installed (something Debian/Ubuntu users must watch out for). - Does not support multi-root workspaces (blindly selects the first workspace).
- Does not try to be smart if no workspace is selected.