A minimal re-implementation of Python's venv module plus utilities
Project description
microvenv
Create a minimal virtual environment (and utility code around environments).
The key purpose of this module is for when the venv
module has been removed from the standard library by your Python distribution. Because venv
is not available on PyPI and is developed in the stdlib, it is not possible to install it using pip
or simply copy the code and expect it to work with older versions of Python. This module then attempts to be that portable alternative for creating virtual environments.
In general, though, using the venv
module should be preferred and this module used as a fallback.
There is also utility code around virtual environments. See the docs for details.
CLI Usage
NOTE: The CLI is not available on Windows.
python microvenv.py [--without-scm-ignore-files] [env_dir=".venv"]
If an argument is provided to the script, it is used as the path to create the virtual environment in. Otherwise, the virtual environment is created in .venv
.
For programmatic usage, there is the create()
function, which is analogous to the venv.create()
function.
def create(env_dir: os.PathLike[str] | str = ".venv", *, scm_ignore_files={"git"}) -> None
The microvenv/_create.py
file is also small enough to have its contents passed in via the -c
flag to python
.
Differences compared to the venv
module
The code operates similarly to py -m venv --symlinks --without-pip .venv
,
except that:
- There are no activation scripts (you can execute
python
in the virtual environment directly) - Windows is not supported
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for microvenv-2023.3.post1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67f0a48511cf16d6a2a45137175d0ddc36a657b91459b598cfbe976ef2afd596 |
|
MD5 | 0cea6896e7cbf2318b14b51d9f77756b |
|
BLAKE2b-256 | 422fac3a5f900c06df538b78ac15c50f8922575a95eb5d590c7ff944f7e906b4 |