Unverified Commit 960483b7 authored by Sagar Yadav's avatar Sagar Yadav Committed by GitHub
Browse files

feat(pip): add alias for updating all requirements via pip (#9965)

* feat(plugins): add alias for pip commands

* feat(plugins): updated README.md and add alias
parent adcb5c5e
...@@ -17,3 +17,12 @@ or you can run `zsh-pip-cache-packages` directly. ...@@ -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 To reset the cache, run `zsh-pip-clear-cache` and it will be rebuilt next
the next time you autocomplete `pip install`. 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 |
...@@ -84,3 +84,14 @@ zsh-pip-test-clean-packages() { ...@@ -84,3 +84,14 @@ zsh-pip-test-clean-packages() {
alias pip="noglob pip" # allows square brackets for pip command invocation 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"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment