GitXplorerGitXplorer
b

microvenv

public
135 stars
6 forks
1 issues

Commits

List of commits on branch main.
Verified
3460d1efdc71eb48af73b17becf653bc5c2b9aae

Update pyproject.toml with a link to fiscal support

bbrettcannon committed 7 months ago
Verified
c2d0e844fff06426f9581acdb4c449ca9f95192e

Create FUNDING.yml

bbrettcannon committed 9 months ago
Verified
6f15602ab1722a68ebf327edec94ffc83d2f6eab

Bump version number

bbrettcannon committed a year ago
Verified
5e796652c3d80894da8ec9c819349ab45d77f3fd

Fix documented invocation of the CLI (#60)

aadamchainz committed a year ago
Verified
7cdcf908438fd1e8b2370624ec80a9ee44a597ec

Get mypy passing under Windows (#58)

bbrettcannon committed a year ago
Verified
d32ca9dc1be5e029d326a240eda5c8137b64009d

Fix `.github/workflows/docs.yml` syntax

bbrettcannon committed a year ago

README

The README file for this repository.

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 python in the virtual environment directly)
  • Windows is not supported