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 used as a fallback.

Usage

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


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.3.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

microvenv-2023.3-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: microvenv-2023.3.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for microvenv-2023.3.tar.gz
Algorithm Hash digest
SHA256 31583dea15f6d2b8f9d13fcaf9c321bb853b15827a09062ec509cdf4a886214b
MD5 43f9a3168fe80b61b13a32a92877199a
BLAKE2b-256 a74283a4feb30f6509066bb5241edd64af89b5bf7e239b0f5ef28d3a0103b804

See more details on using hashes here.

File details

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

File metadata

  • Download URL: microvenv-2023.3-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for microvenv-2023.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c935c80ed832a42c403fb2d2f53e0ff259aa420edc16809c45c18310cba2e1c4
MD5 a178e3900ec09877f58a77cf90261188
BLAKE2b-256 86ff87e98660479de0262cc5ac6eb1cdbd1a31e22cb5669c59538010f4608890

See more details on using hashes here.

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