Create virtualenv environments.
New in version 0.17.0.
Create a virtualenv
The path to the virtualenv to be created
The name (and optionally path) of the virtualenv command. This can also
be set globally in the minion config file as virtualenv.venv_bin.
Defaults to the first virtualenv binary found in the PATH, falling
back to venv when none is installed. The special value venv
selects the
python standard library venv module instead of a virtualenv
binary; a python interpreter (e.g. /usr/bin/python3.11) may also
be given, in which case the environment is created with
<interpreter> -m venv.
Changed in version 3006.28: A python interpreter is now accepted as venv_bin.
Passthrough argument given to virtualenv or venv
Passthrough argument given to virtualenv
Install pip after creating a virtual environment. Implies
distribute=True
Passthrough argument given to virtualenv or venv
The python interpreter to create the environment with. With a
virtualenv binary this is passed as --python; with
venv_bin: venv the environment is created by running
<python> -m venv, so the environment belongs to that
interpreter rather than the one running the Salt minion.
Changed in version 3006.28: With venv_bin: venv this argument used to be rejected; it
now selects the interpreter that runs -m venv. It remains
unsupported for other venv-style binaries such as pyvenv.
Passthrough argument given to virtualenv
Passthrough argument given to virtualenv if True
Passthrough argument given to virtualenv or venv if not None
Changed in version 3006.28: Previously rejected when venv_bin selected the venv
module; the venv module has supported --prompt since
Python 3.6.
Passthrough argument given to venv if True
Passthrough argument given to venv if True
Set ownership for the virtualenv
Note
On Windows you must also pass a password parameter. Additionally,
the user must have permissions to the location where the virtual
environment is being created
Set ownership for the virtualenv
Deprecated since version 2014.1.0: user should be used instead
Use VT terminal emulation (see output while installing)
New in version 2015.5.0.
Specify a different environment. The default environment is base.
New in version 2014.1.0.
Note
The runas argument is deprecated as of 2014.1.0. user should be
used instead.
CLI Example:
salt '*' virtualenv.create /path/to/new/virtualenv
Example of using --always-copy environment variable (in case your fs doesn't support symlinks).
This will copy files into the virtualenv instead of symlinking them.
.. code-block:: yaml
- env:
- VIRTUALENV_ALWAYS_COPY: 1
Return the path to a distribution installed inside a virtualenv
New in version 2016.3.0.
Path to the virtualenv.
Name of the distribution. Note, all non-alphanumeric characters will be converted to dashes.
CLI Example:
salt '*' virtualenv.get_distribution_path /path/to/my/venv my_distribution
Return the content of a package resource installed inside a virtualenv
New in version 2015.5.0.
Path to the virtualenv
Name of the package in which the resource resides
New in version 2016.3.0.
Name of the resource of which the content is to be returned
New in version 2016.3.0.
CLI Example:
salt '*' virtualenv.get_resource_content /path/to/my/venv my_package my/resource.xml
Return the path to a package resource installed inside a virtualenv
New in version 2015.5.0.
Path to the virtualenv
Name of the package in which the resource resides
New in version 2016.3.0.
Name of the resource of which the path is to be returned
New in version 2016.3.0.
CLI Example:
salt '*' virtualenv.get_resource_path /path/to/my/venv my_package my/resource.xml
Return the path to the site-packages directory of a virtualenv
Path to the virtualenv.
CLI Example:
salt '*' virtualenv.get_site_packages /path/to/my/venv
return virtualenv version if exists
Docs for previous releases are available on readthedocs.org.
Latest Salt release: 3007.15