From ac8915d43f0e8de9294c8552dc338ecc9993acd2 Mon Sep 17 00:00:00 2001 From: Diego Said Anaya Mancilla Date: Wed, 28 Sep 2016 14:28:53 -0500 Subject: Update pip plugin to last stable release (#5472) Update pip plugin to last stable release --- plugins/pip/_pip | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) (limited to 'plugins/pip') diff --git a/plugins/pip/_pip b/plugins/pip/_pip index cb155e5f4..732ffabea 100644 --- a/plugins/pip/_pip +++ b/plugins/pip/_pip @@ -1,7 +1,8 @@ #compdef pip pip2 pip-2.7 pip3 pip-3.2 pip-3.3 pip-3.4 #autoload -# pip zsh completion, based on homebrew completion +# pip zsh completion, based on last stable release (pip8) +# homebrew completion and backwards compatibility _pip_all() { # we cache the list of packages (originally from the macports plugin) @@ -17,30 +18,43 @@ _pip_installed() { local -a _1st_arguments _1st_arguments=( - 'bundle:create pybundles (archives containing multiple packages)' + 'install:install packages' + 'download:download packages' + 'uninstall:uninstall packages' 'freeze:output all currently installed packages (exact versions) to stdout' - 'help:show available commands' + 'list:list installed packages' 'show:show information about installed packages' - 'install:install packages' 'search:search PyPI' - 'uninstall:uninstall packages' - 'unzip:unzip individual packages' - 'zip:zip individual packages' + 'wheel:build individual wheel archives for your requirements and dependencies' + 'hash:compute a hash of a local package archive' + 'help:show available commands' + 'bundle:create pybundles (archives containing multiple packages)(deprecated)' + 'unzip:unzip individual packages(deprecated)' + 'zip:zip individual packages(deprecated)' ) local expl local -a all_pkgs installed_pkgs _arguments \ - '(--version)--version[show version number of program and exit]' \ '(-h --help)'{-h,--help}'[show help]' \ - '(-E --environment)'{-E,--environment}'[virtualenv environment to run pip in]' \ - '(-s --enable-site-packages)'{-s,--enable-site-packages}'[include site-packages in virtualenv]' \ + '(--isolated)--isolated[run pip in isolated mode, ignores environment variables and user configuration]' \ '(-v --verbose)'{-v,--verbose}'[give more output]' \ + '(-V --version)'{-V,--version}'[show version number of program and exit]' \ '(-q --quiet)'{-q,--quiet}'[give less output]' \ '(--log)--log[log file location]' \ '(--proxy)--proxy[proxy in form user:passwd@proxy.server:port]' \ + '(--retries)--retries[max number of retries per connection (default 5 times)]' \ '(--timeout)--timeout[socket timeout (default 15s)]' \ + '(--exists-action)--exists-action[default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup]' \ + '(--trusted-host)--trusted-host[mark this host as trusted]' \ + '(--cert)--cert[path to alternate CA bundle]' \ + '(--client-cert)--client-cert[path to SSL client certificate]' \ + '(--cache-dir)--cache-dir[store the cache data in specified directory]' \ + '(--no-cache-dir)--no-cache-dir[disable de cache]' \ + '(--disable-pip-version-check)--disable-pip-version-check[do not check periodically for new pip version downloads]' \ + '(-E --environment)'{-E,--environment}'[virtualenv environment to run pip in (deprecated)]' \ + '(-s --enable-site-packages)'{-s,--enable-site-packages}'[include site-packages in virtualenv (deprecated)]' \ '*:: :->subcmds' && return 0 if (( CURRENT == 1 )); then @@ -56,7 +70,7 @@ case "$words[1]" in _arguments \ '(-l --local)'{-l,--local}'[report only virtualenv packages]' ;; install) - _arguments \ + _arguments \ '(-U --upgrade)'{-U,--upgrade}'[upgrade all packages to the newest available version]' \ '(-f --find-links)'{-f,--find-links}'[URL for finding packages]' \ '(-r --requirement)'{-r,--requirement}'[Requirements file for packages to install]:File:_files' \ -- cgit v1.2.3-70-g09d2 From a7fb55cf13bd5956a183e42916cf160a962b6370 Mon Sep 17 00:00:00 2001 From: yongxin SHI Date: Fri, 8 Dec 2017 07:53:10 +0800 Subject: add pip --user (#6470) --- plugins/pip/_pip | 1 + 1 file changed, 1 insertion(+) (limited to 'plugins/pip') diff --git a/plugins/pip/_pip b/plugins/pip/_pip index 732ffabea..607f68e58 100644 --- a/plugins/pip/_pip +++ b/plugins/pip/_pip @@ -72,6 +72,7 @@ case "$words[1]" in install) _arguments \ '(-U --upgrade)'{-U,--upgrade}'[upgrade all packages to the newest available version]' \ + '(--user)--user[install packages to user home]' \ '(-f --find-links)'{-f,--find-links}'[URL for finding packages]' \ '(-r --requirement)'{-r,--requirement}'[Requirements file for packages to install]:File:_files' \ '(--no-deps --no-dependencies)'{--no-deps,--no-dependencies}'[iIgnore package dependencies]' \ -- cgit v1.2.3-70-g09d2 From e83b70f28b974d8f7bf6a1e29392743952329cf2 Mon Sep 17 00:00:00 2001 From: Fabricio Biazzotto Date: Mon, 8 Apr 2019 17:39:54 -0300 Subject: pip: fix indexes URL (#6986) Fixes #6981. --- plugins/pip/pip.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/pip') diff --git a/plugins/pip/pip.plugin.zsh b/plugins/pip/pip.plugin.zsh index d7236b02a..5539187e1 100644 --- a/plugins/pip/pip.plugin.zsh +++ b/plugins/pip/pip.plugin.zsh @@ -10,7 +10,7 @@ # "zsh-pip-clear-cache". ZSH_PIP_CACHE_FILE=~/.pip/zsh-cache -ZSH_PIP_INDEXES=(https://pypi.python.org/simple/) +ZSH_PIP_INDEXES=(https://pypi.org/simple/) zsh-pip-clear-cache() { rm $ZSH_PIP_CACHE_FILE @@ -31,7 +31,7 @@ zsh-pip-cache-packages() { tmp_cache=/tmp/zsh_tmp_cache for index in $ZSH_PIP_INDEXES ; do # well... I've already got two problems - curl $index 2>/dev/null | \ + curl -L $index 2>/dev/null | \ zsh-pip-clean-packages \ >> $tmp_cache done -- cgit v1.2.3-70-g09d2 From d0b29ff0b3544f6f52fa763d224a91b7b0a08ac2 Mon Sep 17 00:00:00 2001 From: Ryan Greenblatt Date: Sun, 9 Jun 2019 18:02:08 -0400 Subject: pip: fix no such file or directory error (#7916) Zsh may be configured such that ">>" will error if the file doesn't exist (`setopt noclobber`). --- plugins/pip/pip.plugin.zsh | 1 + 1 file changed, 1 insertion(+) (limited to 'plugins/pip') diff --git a/plugins/pip/pip.plugin.zsh b/plugins/pip/pip.plugin.zsh index 5539187e1..aaae90185 100644 --- a/plugins/pip/pip.plugin.zsh +++ b/plugins/pip/pip.plugin.zsh @@ -29,6 +29,7 @@ zsh-pip-cache-packages() { if [[ ! -f $ZSH_PIP_CACHE_FILE ]]; then echo -n "(...caching package index...)" tmp_cache=/tmp/zsh_tmp_cache + touch $tmp_cache for index in $ZSH_PIP_INDEXES ; do # well... I've already got two problems curl -L $index 2>/dev/null | \ -- cgit v1.2.3-70-g09d2 From 51f0eaad61d5870d990386ad8479bcd6a86108b6 Mon Sep 17 00:00:00 2001 From: Sukin Kumar K Date: Tue, 1 Oct 2019 16:43:18 +0530 Subject: Add README for thor and pip plugins (#8185) --- plugins/pip/README.md | 19 +++++++++++++++++++ plugins/thor/README.md | 10 ++++++++++ 2 files changed, 29 insertions(+) create mode 100644 plugins/pip/README.md create mode 100644 plugins/thor/README.md (limited to 'plugins/pip') diff --git a/plugins/pip/README.md b/plugins/pip/README.md new file mode 100644 index 000000000..f07b5c058 --- /dev/null +++ b/plugins/pip/README.md @@ -0,0 +1,19 @@ +# pip plugin + +This plugin adds completion for [pip](https://pip.pypa.io/en/latest/), +the Python package manager. + +To use it, add `pip` to the plugins array in your zshrc file: + +```zsh +plugins=(... pip) +``` + +## pip cache + +The pip plugin caches the names of available pip packages from the PyPI index. +To trigger the caching process, try to complete `pip install`, +or you can run `zsh-pip-cache-packages` directly. + +To reset the cache, run `zsh-pip-clear-cache` and it will be rebuilt next +the next time you autocomplete `pip install`. diff --git a/plugins/thor/README.md b/plugins/thor/README.md new file mode 100644 index 000000000..09c705d9a --- /dev/null +++ b/plugins/thor/README.md @@ -0,0 +1,10 @@ +# Thor plugin + +This plugin adds completion for [Thor](http://whatisthor.com/), +a ruby toolkit for building powerful command-line interfaces. + +To use it, add `thor` to the plugins array in your zshrc file: + +```zsh +plugins=(... thor) +``` -- cgit v1.2.3-70-g09d2