Skip to main content

A minimal re-implementation of Python's venv module

Project description

microvenv

Create a minimal virtual environment.

This module is meant 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 is only used as a fallback.

Usage

python microvenv.py [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 = ".venv") -> None

The microvenv.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 module 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

microvenv-2023.1.1.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

microvenv-2023.1.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file microvenv-2023.1.1.tar.gz.

File metadata

  • Download URL: microvenv-2023.1.1.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for microvenv-2023.1.1.tar.gz
Algorithm Hash digest
SHA256 e42f883f89a6c3a3a2876c529163355a7c94479e775fe6fdf90062738425d6bb
MD5 e5b42ac6b6fdb25279b80d58db3f2204
BLAKE2b-256 830acfab6b82c0577ee66c4bc434f9712e3cd0d5a5da583cceba2cf07e52cb97

See more details on using hashes here.

Provenance

File details

Details for the file microvenv-2023.1.1-py3-none-any.whl.

File metadata

  • Download URL: microvenv-2023.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for microvenv-2023.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0b6ef4111a13dccb56e7ecdca0ae6d1fc1d0c5e05c81d8da89867ea1ce1c9d91
MD5 59c74d50455b64f73a0c2869028f4da4
BLAKE2b-256 a4f5b5ccf166d8b693c223ee4e96456afd05674c611a02d8df234cd4494ebe22

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page