Small Python script to bootstrap a virtual environment, with specified packages.
venv-bootstrap creates a virtual environment, and installs the specified packages using pip. Only the standard library is required; this project was designed to be portable and implemented by other projects to help automate their setup process.
It accepts a space-delimited list of packages and/or requirement files. The venv.EnvBuilder.post_setup()
method can also be overridden to perform other post-creation steps.
- Clone this repo:
git clone https://github.com/Zedeldi/venv-bootstrap.git
- Install build:
pip3 install build
- Build:
python3 -m build
- Install wheel:
pip3 install dist/venv_bootstrap-*-py3-none-any.whl
- Run:
venv-bootstrap -r requirements.txt -p "foo bar baz" .venv
Specify additional options to pip:
--pipopts "--proxy [user:passwd@]proxy.server:port"
To create a venv from a different project, use the following:
from venv_bootstrap import create_venv, parse_requirements
create_venv(".venv", parse_requirements(["requirements.txt"]))
- Cross-platform support
venv-bootstrap
is licensed under the MIT Licence for everyone to use, modify and share freely.
This program is distributed in the hope that it will be useful, but without any warranty.
If you found this project useful, please consider donating. Any amount is greatly appreciated! Thank you 😃
My bitcoin address is: bc1q5aygkqypxuw7cjg062tnh56sd0mxt0zd5md536