venv_management.ext.drivers.pyenv_virtualenv.driver module
Summary
Classes:
Reference
- class venv_management.ext.drivers.pyenv_virtualenv.driver.PyEnvVirtualEnvDriver(name)[source]
Bases:
venv_management.driver.Driver
- list_virtual_envs() List[str] [source]
A list of virtualenv names.
- Returns
A list of string names in case-sensitive alphanumeric order.
- Raises
FileNotFoundError – If virtualenvwrapper.sh could not be located.
- make_virtual_env(name, *, python=None, project_path=None, packages=None, requirements_file=None, system_site_packages=False, pip=True, setuptools=True, wheel=True)[source]
Make a virtual env.
- Parameters
name – The name of the virtual environment.
project_path – An optional path to a project which will be associated with the new virtual environment. (not supported by pyenv-virtualenv)
packages – An optional sequence of package names for packages to be installed. (not supported by pyenv-virtualenv)
requirements_file – An optional path to a requirements file to be installed. (not supported by pyenv-virtualenv)
python – The target interpreter for which to create a virtual environment, either the name of the executable, or full path.
system_site_packages – If True, give access to the system site packages.
pip – If True, or ‘latest’ the latest pip will be installed. If False, pip will not be installed. If ‘bundled’, the bundled version will be installed. If a specific version string is given, that version will be installed.
setuptools – If True, or ‘latest’ the latest setuptools will be installed. If False, setuptools will not be installed. If ‘bundled’, the bundled version will be installed. If a specific version string is given, that version will be installed.
wheel – If True, or ‘latest’ the latest pip will be installed. If False, pip will not be installed. If ‘bundled’, the bundled version will be installed. If a specific version string is given, that version will be installed.
- Returns
The Path to the root of the virtualenv, or None if the path could not be determined.
- Raises
CommandNotFound – If the required command could not be found.
RuntimeError – If the virtualenv could not be created.
- remove_virtual_env(name)[source]
Remove a virtual environment.
- Parameters
name – The name of the virtual environment to remove.
- Raises
ValueError – If there is no environment with the given name.
RuntimeError – If the virtualenv could not be removed.
- resolve_virtual_env(name: str) pathlib.Path [source]
Resolve the path to a virtual environment.
- Parameters
name – The name of the virtual environment.
- Returns
The path to the virtual environment in the $HOME/.pyenv/versions/<virtual_env_name> format.