venv_management.ext.drivers.virtualenv_sh.driver module

Summary

Classes:

VirtualEnvShDriver

Reference

class venv_management.ext.drivers.virtualenv_sh.driver.VirtualEnvShDriver(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.

  • packages – An optional sequence of package names for packages to be installed.

  • requirements_file – An optional path to a requirements file to be installed.

  • 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 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.

  • 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
remove_virtual_env(name)[source]

Remove a virtual environment.

Parameters

name – The name of the virtual environment to be removed.

Raises

ValueError – If the name is empty.

resolve_virtual_env(name: str) pathlib.Path[source]

Obtain a path to the virtual environment directory.

Parameters

name – The name of the virtual environment.

Returns

The path of the named virtual environment.

Raises

ValueError – If there is no virtual environment with the supplied name.