b7e05f136640678539f90e0fa32475bd12c8d930

Author
baltic-tea <97766478+baltic-tea@users.noreply.github.com>
Committer
GitHub <noreply@github.com>
Date

Message

feat(poetry): add aliases (#11858)

Diff

 1diff --git a/plugins/poetry/README.md b/plugins/poetry/README.md
 2index 51780cbeda8d59b2c92fca6b7014392bf4806e79..7b7905a4119c01a7cfd12c1ee086150e4c0d05ac 100644
 3--- a/plugins/poetry/README.md
 4+++ b/plugins/poetry/README.md
 5@@ -7,3 +7,36 @@ To use it, add `poetry` to the plugins array in your zshrc file:
 6 ```zsh
 7 plugins=(... poetry)
 8 ```
 9+
10+## Aliases
11+
12+| Alias | Command                                            | Description    
13+|:----- |--------------------------------------------------- |:--------------------------------------------------------------------------------------- |
14+| pad   | `poetry add`                                       | Add packages to `pyproject.toml` and install them                                       |
15+| pbld  | `poetry build`                                     | Build the source and wheels archives                                                    |
16+| pch   | `poetry check`                                     | Validate the content of the `pyproject.toml` and its consistency with the `poetry.lock` |
17+| pcmd  | `poetry list`                                      | Display all the available Poetry commands                                               |
18+| pconf | `poetry config --list`                             | Allow you to edit poetry config settings and repositories                               |
19+| pexp  | `poetry export --without-hashes > requirements.txt | Export the lock file to `requirements.txt`                                              |
20+| pin   | `poetry init`                                      | Create a `pyproject.toml` interactively                                                 |
21+| pinst | `poetry install`                                   | Read the `pyproject.toml`, resolve the dependencies, and install them                   |
22+| plck  | `poetry lock`                                      | Lock the dependencies in `pyproject.toml` without installing                            |
23+| pnew  | `poetry new`                                       | Create a directory structure suitable for most Python projects                          |
24+| ppath | `poetry env info --path`                           | Get the path of the currently activated virtualenv`                                     |
25+| pplug | `poetry self show plugins`                         | List all the installed Poetry plugins                                                   |
26+| ppub  | `poetry publish`                                   | Publish the builded (`poetry build` command) package to the remote repository           |
27+| prm   | `poetry remove`                                    | Remove packages from `pyproject.toml` and uninstall them                                |
28+| prun  | `poetry run`                                       | Executes the given command inside the project’s virtualenv                              |
29+| psad  | `poetry self add`                                  | Add the Poetry plugin and install dependencies to make it work                          |
30+| psh   | `poetry shell`                                     | Spawns a shell within the virtual environment. If one doesn’t exist, it will be created |
31+| pshw  | `poetry show`                                      | List all the available dependencies                                                     |
32+| pslt  | `poetry show --latest`                             | List lastest version of the dependencies                                                |
33+| psup  | `poetry self update`                               | Update Poetry to the latest version (default) or to the specified version               |
34+| psync | `poetry install --sync`                            | Synchronize your environment with the `poetry.lock`                                     |
35+| ptree | `poetry show --tree`                               | List the dependencies as tree                                                           |
36+| pup   | `poetry update`                                    | Get the latest versions of the dependencies and to update the `poetry.lock`             |
37+| pvinf | `poetry env info`                                  | Get basic information about the currently activated virtualenv                          |
38+| pvoff | `poetry config virtualenvs.create false`           | Disable automatic virtualenv creation                                                   |
39+| pvrm  | `poetry env remove`                                | Delete existing virtualenvs                                                             |
40+| pvrma | `poetry env remove --all`                          | Delete all existing virtualenvs                                                         |
41+| pvu   | `poetry env use`                                   | Switch between existing virtualenvs                                                     |
42diff --git a/plugins/poetry/poetry.plugin.zsh b/plugins/poetry/poetry.plugin.zsh
43index cebcb46c40e8c20ae57b1d853d270333eca7ea98..fe6a0f7ed422dfabfd71fd05e19390146e37d954 100644
44--- a/plugins/poetry/poetry.plugin.zsh
45+++ b/plugins/poetry/poetry.plugin.zsh
46@@ -1,3 +1,31 @@
47+alias pad='poetry add'
48+alias pbld='poetry build'
49+alias pch='poetry check'
50+alias pcmd='poetry list'
51+alias pconf='poetry config --list'
52+alias pexp='poetry export --without-hashes > requirements.txt'
53+alias pin='poetry init'
54+alias pinst='poetry install'
55+alias plck='poetry lock'
56+alias pnew='poetry new'
57+alias ppath='poetry env info --path'
58+alias pplug='poetry self show plugins'
59+alias ppub='poetry publish'
60+alias prm='poetry remove'
61+alias prun='poetry run'
62+alias psad='poetry self add'
63+alias psh='poetry shell'
64+alias pshw='poetry show'
65+alias pslt='poetry show --latest'
66+alias psup='poetry self update'
67+alias psync='poetry install --sync'
68+alias ptree='poetry show --tree'
69+alias pup='poetry update'
70+alias pvinf='poetry env info'
71+alias pvoff='poetry config virtualenvs.create false'
72+alias pvrm='poetry env remove'
73+alias pvu='poetry env use'
74+
75 # Return immediately if poetry is not found
76 if (( ! $+commands[poetry] )); then
77   return