salt.modules.pip
Install Python packages with pip to either the system or a virtualenv
-
salt.modules.pip.freeze(bin_env=None, runas=None, cwd=None)
Return a list of installed packages either globally or in the specified
virtualenv
- bin_env
- path to pip bin or path to virtualenv. If doing an uninstall from
the system python and want to use a specific pip bin (pip-2.7,
pip-2.6, etc..) just specify the pip bin you want.
If uninstalling from a virtualenv, just use the path to the virtualenv
(/home/code/path/to/virtualenv/)
- runas
- User to run pip as
- cwd
- Current working directory to run pip from
CLI Example:
salt '*' pip.freeze /home/code/path/to/virtualenv/
-
salt.modules.pip.install(pkgs=None, requirements=None, env=None, bin_env=None, log=None, proxy=None, timeout=None, editable=None, find_links=None, index_url=None, extra_index_url=None, no_index=False, mirrors=None, build=None, target=None, download=None, download_cache=None, source=None, upgrade=False, force_reinstall=False, ignore_installed=False, no_deps=False, no_install=False, no_download=False, install_options=None, runas=None, cwd=None, __env__='base')
Install packages with pip
Install packages individually or from a pip requirements file. Install
packages globally or to a virtualenv.
- pkgs
- comma separated list of packages to install
- requirements
- path to requirements
- bin_env
- path to pip bin or path to virtualenv. If doing a system install,
and want to use a specific pip bin (pip-2.7, pip-2.6, etc..) just
specify the pip bin you want.
If installing into a virtualenv, just use the path to the virtualenv
(/home/code/path/to/virtualenv/)
- env
- deprecated, use bin_env now
- log
- Log file where a complete (maximum verbosity) record will be kept
- proxy
- 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.
- timeout
- Set the socket timeout (default 15 seconds)
- editable
- install something editable(ie git+https://github.com/worldcompany/djangoembed.git#egg=djangoembed)
- find_links
- URL to look for packages at
- index_url
- Base URL of Python Package Index
- extra_index_url
- Extra URLs of package indexes to use in addition to index_url
- no_index
- Ignore package index
- mirrors
- Specific mirror URLs to query (automatically adds --use-mirrors)
- build
- Unpack packages into build dir
- target
- Install packages into target dir
- download
- Download packages into download instead of installing them
- download_cache
- Cache downloaded packages in download_cache dir
- source
- Check out editable packages into source dir
- upgrade
- Upgrade all packages to the newest available version
- force_reinstall
- When upgrading, reinstall all packages even if they are already up-to-date.
- ignore_installed
- Ignore the installed packages (reinstalling instead)
- no_deps
- Ignore package dependencies
- no_install
- Download and unpack all packages, but don't actually install them
- no_download
- Don't download any packages, just install the ones
already downloaded (completes an install run with
--no-install)
- install_options
- Extra arguments to be supplied to the setup.py install
command (use like --install-option="--install-
scripts=/usr/local/bin"). Use multiple --install-
option options to pass multiple options to setup.py
install. If you are using an option with a directory
path, be sure to use absolute path.
- runas
- User to run pip as
- cwd
- Current working directory to run pip from
CLI Example:
salt '*' pip.install <package name>,<package2 name>
salt '*' pip.install requirements=/path/to/requirements.txt
salt '*' pip.install <package name> bin_env=/path/to/virtualenv
salt '*' pip.install <package name> bin_env=/path/to/pip_bin
Comlicated CLI example:
salt '*' pip.install markdown,django editable=git+https://github.com/worldcompany/djangoembed.git#egg=djangoembed upgrade=True no_deps=True
-
salt.modules.pip.list(prefix='', bin_env=None, runas=None, cwd=None)
Filter list of installed apps from freeze and check to see if
prefix exists in the list of packages installed.
CLI Example:
-
salt.modules.pip.uninstall(pkgs=None, requirements=None, bin_env=None, log=None, proxy=None, timeout=None, runas=None, cwd=None, __env__='base')
Uninstall packages with pip
Uninstall packages individually or from a pip requirements file. Uninstall
packages globally or from a virtualenv.
- pkgs
- comma separated list of packages to install
- requirements
- path to requirements
- bin_env
- path to pip bin or path to virtualenv. If doing an uninstall from
the system python and want to use a specific pip bin (pip-2.7,
pip-2.6, etc..) just specify the pip bin you want.
If uninstalling from a virtualenv, just use the path to the virtualenv
(/home/code/path/to/virtualenv/)
- log
- Log file where a complete (maximum verbosity) record will be kept
- proxy
- 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.
- timeout
- Set the socket timeout (default 15 seconds)
- runas
- User to run pip as
- cwd
- Current working directory to run pip from
CLI Example:
salt '*' pip.uninstall <package name>,<package2 name>
salt '*' pip.uninstall requirements=/path/to/requirements.txt
salt '*' pip.uninstall <package name> bin_env=/path/to/virtualenv
salt '*' pip.uninstall <package name> bin_env=/path/to/pip_bin