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 -m microvenv [--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
pythonin 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file microvenv-2025.0.tar.gz.
File metadata
- Download URL: microvenv-2025.0.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a2568a8390a4ffb5af2f05e7642454e03b887e582d192b6316326974eab5d0f
|
|
| MD5 |
ea993578ac9cb0165903923918ab964f
|
|
| BLAKE2b-256 |
8489d30e42ec51af9f822087942a7bbfa0e156f35c8575be7949aead5d60f2b7
|
Provenance
The following attestation bundles were made for microvenv-2025.0.tar.gz:
Publisher:
release.yml on brettcannon/microvenv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
microvenv-2025.0.tar.gz -
Subject digest:
8a2568a8390a4ffb5af2f05e7642454e03b887e582d192b6316326974eab5d0f - Sigstore transparency entry: 288066699
- Sigstore integration time:
-
Permalink:
brettcannon/microvenv@39516fb2fc4bb64ae9ecbc4e9791713ca26bcadb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/brettcannon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@39516fb2fc4bb64ae9ecbc4e9791713ca26bcadb -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file microvenv-2025.0-py3-none-any.whl.
File metadata
- Download URL: microvenv-2025.0-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
568155ec18af01c89f270d35d123ab803b09672b480c3702d15fd69e9cc5bd1e
|
|
| MD5 |
3034443747867fe8d6e35f444a28617f
|
|
| BLAKE2b-256 |
6dbffef7bca8a0049da3535e5b0117e9e6c16d6ad9bc9f793074e621c5a572ef
|
Provenance
The following attestation bundles were made for microvenv-2025.0-py3-none-any.whl:
Publisher:
release.yml on brettcannon/microvenv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
microvenv-2025.0-py3-none-any.whl -
Subject digest:
568155ec18af01c89f270d35d123ab803b09672b480c3702d15fd69e9cc5bd1e - Sigstore transparency entry: 288066731
- Sigstore integration time:
-
Permalink:
brettcannon/microvenv@39516fb2fc4bb64ae9ecbc4e9791713ca26bcadb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/brettcannon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@39516fb2fc4bb64ae9ecbc4e9791713ca26bcadb -
Trigger Event:
workflow_dispatch
-
Statement type: