Skip to content

Zedeldi/venv-bootstrap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

venv-bootstrap

GitHub license GitHub last commit Code style: black

Small Python script to bootstrap a virtual environment, with specified packages.

Description

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.

Installation

  1. Clone this repo: git clone https://github.com/Zedeldi/venv-bootstrap.git
  2. Install build: pip3 install build
  3. Build: python3 -m build
  4. Install wheel: pip3 install dist/venv_bootstrap-*-py3-none-any.whl
  5. Run: venv-bootstrap -r requirements.txt -p "foo bar baz" .venv

Usage

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"]))

Todo

  • Cross-platform support

License

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.

Donate

If you found this project useful, please consider donating. Any amount is greatly appreciated! Thank you 😃

PayPal

My bitcoin address is: bc1q5aygkqypxuw7cjg062tnh56sd0mxt0zd5md536

About

Small Python script to bootstrap a virtual environment, with specified packages.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages