diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2021-07-11 19:58:51 -0600 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2021-07-11 19:58:51 -0600 |
commit | 617ed3bd9f3d9519fe2354941f3dbf15b0c712ee (patch) | |
tree | caf617b35d3f5f7b5786483eedfcda9361dca108 /plugins/pip | |
parent | 0144641b7d8e4e6ff6ce153039b5a827f5347904 (diff) | |
parent | 36f444ed7325720ec05f182781ec7d6c9a4d675c (diff) | |
download | zsh-617ed3bd9f3d9519fe2354941f3dbf15b0c712ee.tar.gz zsh-617ed3bd9f3d9519fe2354941f3dbf15b0c712ee.tar.bz2 zsh-617ed3bd9f3d9519fe2354941f3dbf15b0c712ee.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'plugins/pip')
-rw-r--r-- | plugins/pip/README.md | 9 | ||||
-rw-r--r-- | plugins/pip/pip.plugin.zsh | 11 |
2 files changed, 20 insertions, 0 deletions
diff --git a/plugins/pip/README.md b/plugins/pip/README.md index f07b5c058..88d88227e 100644 --- a/plugins/pip/README.md +++ b/plugins/pip/README.md @@ -17,3 +17,12 @@ 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`. + +## Aliases + +| Alias | Description | +| :------- | :-------------------------------------------- | +| pipreq | Create requirements file | +| pipir | Install packages from `requirements.txt` file | +| pipupall | Update all installed packages | +| pipunall | Uninstall all installed packages | diff --git a/plugins/pip/pip.plugin.zsh b/plugins/pip/pip.plugin.zsh index a46e7658c..629147bae 100644 --- a/plugins/pip/pip.plugin.zsh +++ b/plugins/pip/pip.plugin.zsh @@ -84,3 +84,14 @@ zsh-pip-test-clean-packages() { alias pip="noglob pip" # allows square brackets for pip command invocation +# Create requirements file +alias pipreq="pip freeze > requirements.txt" + +# Update all installed packages +alias pipupall="pipreq && sed -i 's/==/>=/g' requirements.txt && pip install -r requirements.txt --upgrade && rm -rf requirements.txt" + +# Install packages from requirements file +alias pipir="pip install -r requirements.txt" + +# Uninstalled all installed packages +alias pipunall="pipreq && pip uninstall -r requirements.txt -y && rm -rf requirements.txt" |