Public API

Create virtual environments with repo-helper.

Functions:

install_requirements(session, requirements_file)

Install requirements into a virtualenv.

mkdevenv(repo_dir[, venv_dir, verbosity, …])

Create a “devenv”.

read_pyvenv(venv_dir)

Reads the pyvenv.cfg for the given virtualenv, and returns a key: value mapping of its contents.

install_requirements(session, requirements_file, verbosity=1, *, upgrade=False)[source]

Install requirements into a virtualenv.

Parameters
  • session (Session)

  • requirements_file (Union[str, Path, PathLike])

  • verbosity (int) – The verbosity of the function. 0 = quiet, 2 = very verbose. Default 1.

  • upgrade (bool) – Whether to upgrade all specified packages to the newest available version. Default False.

Changed in version 0.4.0: Added the upgrade keyword-only argument.

Deprecated since version 0.5.0: This will be removed in 1.0.0.

mkdevenv(repo_dir, venv_dir='venv', verbosity=1, *, upgrade=False)[source]

Create a “devenv”.

New in version 0.3.2.

Parameters
  • repo_dir (Union[str, Path, PathLike]) – The root of the repository to create the devenv for.

  • venv_dir (Union[str, Path, PathLike]) – The directory to create the devenv in, relative to repo_dir. Default 'venv'.

  • verbosity (int) – The verbosity of the function. 0 = quiet, 2 = very verbose. Default 1.

  • upgrade (bool) – Whether to upgrade all specified packages to the newest available version. Default False.

Return type

int

Changed in version 0.4.0: Added the upgrade keyword-only argument.

read_pyvenv(venv_dir)[source]

Reads the pyvenv.cfg for the given virtualenv, and returns a key: value mapping of its contents.

New in version 0.3.2.

Parameters

venv_dir (Union[str, Path, PathLike])

Return type

Dict[str, str]

Deprecated since version 0.4.0: This will be removed in 1.0.0. Use ‘shippinglabel.read_pyvenv’ instead.