These states manage system installed python packages. Note that pip must be
installed for these states to be available, so pip states should include a
requisite to a pkg.installed state for the package which provides pip
(python-pip
in most cases). Example:
python-pip:
pkg.installed
virtualenvwrapper:
pip.installed:
- require:
- pkg: python-pip
Make sure the package is installed
The name of the python package to install. You can also specify version
numbers here using the standard operators ==, >=, <=
. If
requirements
or pkgs
is given, this parameter will be ignored.
Example:
django:
pip.installed:
- name: django >= 1.6, <= 1.7
- require:
- pkg: python-pip
Installs the latest Django version greater than 1.6 but less than 1.7.
A list of python packages to install. This let you install multiple packages at the same time.
Example:
django-and-psycopg2:
pip.installed:
- pkgs:
- django >= 1.6, <= 1.7
- psycopg2 >= 2.8.4
- require:
- pkg: python-pip
Installs the latest Django version greater than 1.6 but less than 1.7 and the latest psycopg2 greater than 2.8.4 at the same time.
Path to a pip requirements file. If the path begins with salt:// the file will be transferred from the master file server.
The user under which to run pip
Prefer wheel archives (requires pip>=1.4)
Force to not use wheel archives (requires pip>=1.4)
Force to not use binary packages (requires pip >= 7.0.0) Accepts either :all: to disable all binary packages, :none: to empty the set, or a list of one or more packages
Example:
django:
pip.installed:
- no_binary: ':all:'
flask:
pip.installed:
- no_binary:
- itsdangerous
- click
Log file where a complete (maximum verbosity) record will be kept
Specify a proxy in the form user:passwd@proxy.server:port. Note that the user:password@ is optional and required only if you are behind an authenticated proxy. If you provide user@proxy.server:port then you will be prompted for a password.
Set the socket timeout (default 15 seconds)
install something editable (i.e. git+https://github.com/worldcompany/djangoembed.git#egg=djangoembed)
URL to look for packages at
Base URL of Python Package Index
Extra URLs of package indexes to use in addition to index_url
Ignore package index
Specific mirror URL(s) to query (automatically adds --use-mirrors)
Unpack packages into build
dir
Install packages into target
dir
Download packages into download
instead of installing them
Cache downloaded packages in download_cache
dir
Check out editable
packages into source
dir
Upgrade all packages to the newest available version
When upgrading, reinstall all packages even if they are already up-to-date.
Ignore the installed packages (reinstalling instead)
Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup
Ignore package dependencies
Download and unpack all packages, but don't actually install them
Disable the cache.
Current working directory to run pip from
Include pre-releases in the available versions
Provide a path to an alternate CA bundle
Allow the installation of all externally hosted files
Allow the installation of externally hosted files (comma separated list)
Allow the installation of insecure and unverifiable files (comma separated list)
Enable the processing of dependency links
Add or modify environment variables. Useful for tweaking build steps, such as specifying INCLUDE or LIBRARY paths in Makefiles, build scripts or compiler calls. This must be in the form of a dictionary or a mapping.
Example:
django:
pip.installed:
- name: django_app
- env_vars:
CUSTOM_PATH: /opt/django_app
VERBOSE: True
Use VT terminal emulation (see output while installing)
Mark this host as trusted, even though it does not have valid or any HTTPS.
Absolute path to a virtual environment directory or absolute path to
a pip executable. The example below assumes a virtual environment
has been created at /foo/.virtualenvs/bar
.
Example:
django:
pip.installed:
- name: django >= 1.6, <= 1.7
- bin_env: /foo/.virtualenvs/bar
- require:
- pkg: python-pip
Or
Example:
django:
pip.installed:
- name: django >= 1.6, <= 1.7
- bin_env: /foo/.virtualenvs/bar/bin/pip
- require:
- pkg: python-pip
Attention
The following arguments are deprecated, do not use.
Deprecated, use bin_env
Changed in version 0.17.0: use_wheel
option added.
install_options
Extra arguments to be supplied to the setup.py install command. If you are using an option with a directory path, be sure to use absolute path.
Example:
django: pip.installed: - name: django - install_options: - --prefix=/blah - require: - pkg: python-pip
Extra global options to be supplied to the setup.py call before the install command.
New in version 2014.1.3.
Attention
As of Salt 0.17.0 the pip state needs an importable pip module. This usually means having the system's pip package installed or running Salt from an active virtualenv.
The reason for this requirement is because pip
already does a
pretty good job parsing its own requirements. It makes no sense for
Salt to do pip
requirements parsing and validation before passing
them to the pip
library. It's functionality duplication and it's
more error prone.
Attention
Please set reload_modules: True
to have the salt minion
import this module after installation.
Example:
pyopenssl:
pip.installed:
- name: pyOpenSSL
- reload_modules: True
- exists_action: i
pip keyword and positional arguments not yet implemented in salt
pandas:
pip.installed:
- name: pandas
- extra_args:
- --latest-pip-kwarg: param
- --latest-pip-arg
Warning
If unsupported options are passed here that are not supported in a minion's version of pip, a No such option error will be thrown.
If you are using onedir packages and you need to install python packages into the system python environment, you must provide the pip_bin or bin_env to the pip state module.
lib-foo:
pip.installed:
- pip_bin: /usr/bin/pip3
lib-bar:
pip.installed:
- bin_env: /usr/bin/python3
True when the pip version has the pip.exceptions module
True when the pip version has the pip._internal.exceptions module
Purge pip and its sub-modules
Make sure that a package is not installed.
The name of the package to uninstall
The user under which to run pip
the pip executable or virtualenenv to use
Use VT terminal emulation (see output while installing)
New in version 2015.5.0.
Verify that the system is completely up to date.
The name has no functional value and is only used as a tracking reference
The user under which to run pip
the pip executable or virtualenenv to use
Use VT terminal emulation (see output while installing)