31-08-2021

This commit is contained in:
2021-08-31 09:29:05 +02:00
parent 7d89fb0224
commit bb890cba15
28 changed files with 1888 additions and 47 deletions

172
docs/macos/python/pipx.md Normal file
View File

@@ -0,0 +1,172 @@
# pipx
#### Installation:
```bash
$ brew install pipx
$ pipx ensurepath
```
#### Complétions:
Ajouter à `.zshrc`:
```bash
autoload -U bashcompinit && bashcompinit
eval "$(register-python-argcomplete pipx)"
```
#### Installer un paquet:
```bash
$ pipx install soco-cli
```
Le paquet est installé dans un environnement virtuel sous `~/.local/pipx/venvs`
```bash
~/.local/pipx/venvs/soco-cli/bin
$ ls -la
Permissions Size User Group Date Modified Date Created Name
.rw-r--r-- 1,9Ki bruno staff 17 aoû 10:47 17 aoû 10:47  activate
.rw-r--r-- 867 bruno staff 17 aoû 10:47 17 aoû 10:47  activate.csh
.rw-r--r-- 2,0Ki bruno staff 17 aoû 10:47 17 aoû 10:47  activate.fish
.rw-r--r-- 8,6Ki bruno staff 17 aoû 10:47 17 aoû 10:47  Activate.ps1
.rwxr-xr-x 278 bruno staff 17 aoû 10:47 17 aoû 10:47  normalizer*
lrwxr-xr-x 9 bruno staff 17 aoû 10:47 17 aoû 10:47  python@
lrwxr-xr-x 9 bruno staff 17 aoû 10:47 17 aoû 10:47  python3@
lrwxr-xr-x 42 bruno staff 17 aoû 10:47 17 aoû 10:47  python3.9@
.rwxr-xr-x 247 bruno staff 17 aoû 10:47 17 aoû 10:47  soco*
.rwxr-xr-x 256 bruno staff 17 aoû 10:47 17 aoû 10:47  soco-discover*
.rwxr-xr-x 250 bruno staff 17 aoû 10:47 17 aoû 10:47  soco-http-api-server*
.rwxr-xr-x 247 bruno staff 17 aoû 10:47 17 aoû 10:47  sonos*
.rwxr-xr-x 256 bruno staff 17 aoû 10:47 17 aoû 10:47  sonos-discover*
.rwxr-xr-x 250 bruno staff 17 aoû 10:47 17 aoû 10:47  sonos-http-api-server*
.rwxr-xr-x 243 bruno staff 17 aoû 10:47 17 aoû 10:47  tabulate*
.rwxr-xr-x 245 bruno staff 17 aoû 10:47 17 aoû 10:47  uvicorn*
```
```bash
$ which soco
/Users/bruno/.local/bin/soco
```
#### Exécuter un paquet sans l'installer:
```bash
$ pipx run pycowsay Meuuuhh !
⚠️ pycowsay is already on your PATH and installed at /Users/bruno/.local/bin/pycowsay. Downloading and running anyway.
---------
< Meuuuhh ! >
---------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
```
#### Liste des paquets installés:
```bash
$ pipx list
venvs are in /Users/bruno/.local/pipx/venvs
apps are exposed on your $PATH at /Users/bruno/.local/bin
package pycowsay 0.0.0.1, Python 3.9.6
- pycowsay
package soco-cli 0.4.15, Python 3.9.6
- soco
- soco-discover
- soco-http-api-server
- sonos
- sonos-discover
- sonos-http-api-server
```
Avec les paquets additionnels:
```bash
$ pipx list --include-injected
venvs are in /Users/bruno/.local/pipx/venvs
apps are exposed on your $PATH at /Users/bruno/.local/bin
package mkdocs 1.2.2, Python 3.9.6
- mkdocs
Injected Packages:
- fontawesome-markdown 0.2.6
- mkdocs-git-revision-date-localized-plugin 0.9.2
- mkdocs-material 7.2.4
- mkdocs-material-extensions 1.0.1
- mkdocs-minify-plugin 0.4.0
- mkdocs-pdf-export-plugin 0.5.8
package pycowsay 0.0.0.1, Python 3.9.6
- pycowsay
```
#### Installer un paquet dans un environnement virtuel:
```bash
$ pipx inject mkdocs mkdocs-material mkdocs-material-extensions mkdocs-minify-plugin mkdocs-git-revision-date-localized-plugin mkdocs-pdf-export-plugin fontawesome_markdown
injected package mkdocs-material into venv mkdocs
done! ✨ 🌟 ✨
injected package mkdocs-material-extensions into venv mkdocs
done! ✨ 🌟 ✨
injected package mkdocs-minify-plugin into venv mkdocs
done! ✨ 🌟 ✨
injected package mkdocs-git-revision-date-localized-plugin into venv mkdocs
done! ✨ 🌟 ✨
injected package mkdocs-pdf-export-plugin into venv mkdocs
done! ✨ 🌟 ✨
injected package fontawesome-markdown into venv mkdocs
done! ✨ 🌟 ✨
```
#### Mise-à-jour:
```bash
$ pipx upgrade soco-cli
soco-cli is already at latest version 0.4.15 (location: /Users/bruno/.local/pipx/venvs/soco-cli)
```
Mettre également à jour les paquets additionnels:
```bash
$ pipx upgrade mkdocs --include-injected
mkdocs is already at latest version 1.2.2 (location: /Users/bruno/.local/pipx/venvs/mkdocs)
fontawesome-markdown is already at latest version 0.2.6 (location: /Users/bruno/.local/pipx/venvs/mkdocs)
mkdocs-git-revision-date-localized-plugin is already at latest version 0.9.2 (location: /Users/bruno/.local/pipx/venvs/mkdocs)
mkdocs-material is already at latest version 7.2.4 (location: /Users/bruno/.local/pipx/venvs/mkdocs)
mkdocs-material-extensions is already at latest version 1.0.1 (location: /Users/bruno/.local/pipx/venvs/mkdocs)
mkdocs-minify-plugin is already at latest version 0.4.0 (location: /Users/bruno/.local/pipx/venvs/mkdocs)
mkdocs-pdf-export-plugin is already at latest version 0.5.8 (location: /Users/bruno/.local/pipx/venvs/mkdocs)p
```
```bash
$ pipx upgrade-all
Versions did not change after running 'pip upgrade' for each package 😴
```
#### Aide:
```bash
$ pipx --help
$ pipx <commande> --help
```

View File

@@ -0,0 +1,49 @@
# Poetry
#### Installation:
```bash
$ curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python3 -
```
Ajouter Poetry au $PATH dans `.zshrc`:
```bash
export PATH="/Users/bruno/Library/Python/3.9/bin:$PATH"
```
Complétions:
```bash
# Zsh
$ poetry completions zsh > ~/.zfunc/_poetry
# For poetry: https://github.com/python-poetry/poetry#enable-tab-completion-for-bash-fish-or-zsh
fpath+=~/.zfunc
# additional completions
autoload -U +X compinit && compinit
# Bash (Homebrew)
$ poetry completions bash > $(brew --prefix)/etc/bash_completion.d/poetry.bash-completion
```
#### Désinstallation:
```bash
$ curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python3 - --uninstall
```
#### Mise-à-jour:
```bash
$ poetry self update
```