MaJ du 04-02-2021
This commit is contained in:
@@ -76,7 +76,7 @@ $ pip3 --no-cache-dir install mkdocs
|
||||
|
||||
## Environnement virtuel:
|
||||
|
||||
|
||||
Création de l'environnement virtuel pour l'application MkDocs:
|
||||
|
||||
```bash
|
||||
# Création de l'environnement virtuel
|
||||
@@ -90,27 +90,41 @@ $ mkdocs_env/bin/pip3 install mkdocs
|
||||
# Installation du thème
|
||||
$ mkdocs_env/bin/pip3 install mkdocs-material pymdown-extensions pygments
|
||||
# Installation des plugins
|
||||
$ mkdocs_env/bin/pip3 install mkdocs-pdf-export-plugin mkdocs-minify-plugin
|
||||
$ mkdocs_env/bin/pip3 install mkdocs-pdf-export-plugin mkdocs-minify-plugin mkdocs-pdf-export-plugin
|
||||
# Installation du plugin depuis les sources
|
||||
$ mkdocs_env/bin/pip3 install mkdocs-pdf-export-plugin-0.5.5.tar.gz
|
||||
# $ mkdocs_env/bin/pip3 install mkdocs-pdf-export-plugin-0.5.5.tar.gz
|
||||
|
||||
# Mise-à-jour
|
||||
$ mkdocs_env/bin/pip3 install -U mkdocs
|
||||
|
||||
# Mise-à-jour de l'environnement virtuel
|
||||
$ python3 -m venv --upgrade mkdocs_env
|
||||
|
||||
up_venv() {
|
||||
/Users/bruno/Documents/venv/$1/bin/python3 -m venv --upgrade $1
|
||||
}
|
||||
$ up_venv mkdocs
|
||||
|
||||
# Mise-à-jour de l'application dans un venv
|
||||
up_venv_mod() {
|
||||
pip_venv="/Users/bruno/Documents/venv/$1/bin/pip3"
|
||||
$pip_venv list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 $pip_venv install -U
|
||||
}
|
||||
$ up_venv_mod mkdocs
|
||||
```
|
||||
|
||||
|
||||
Initialisation et démarrage de MkDocs:
|
||||
|
||||
```bash
|
||||
~/Documents/mydocs master*
|
||||
~/Documents/docs master*
|
||||
|
||||
# Création d'un nouveau projet
|
||||
$ ~/Documents/mkdocs_env/bin/mkdocs new
|
||||
$ ~/Documents/venv/mkdocs/bin/mkdocs new ~/Documents/docs
|
||||
INFO - Writing config file: /Users/bruno/Documents/docs/mkdocs.yml
|
||||
INFO - Writing initial docs: /Users/bruno/Documents/docs/docs/index.md
|
||||
|
||||
# Démarrage de mkdocs
|
||||
$ ~/Documents/mkdocs_env/bin/mkdocs serve
|
||||
$ ~/Documents/venv/mkdocs/bin/mkdocs serve
|
||||
INFO - Building documentation...
|
||||
INFO - Cleaning site directory
|
||||
```
|
||||
@@ -128,6 +142,16 @@ mkdocs_env ❯ mkdocs serve
|
||||
mkdocs_env ❯ deactivate
|
||||
```
|
||||
|
||||
Mise-à-jour des modules:
|
||||
|
||||
```bash
|
||||
up_venv_mod() {
|
||||
/Users/bruno/Documents/venv/$1/bin/pip3 list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U
|
||||
}
|
||||
|
||||
$ up_venv mkdocs_env
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Modules:
|
||||
@@ -437,6 +461,13 @@ $ pip3 show mkdocs | grep Requires
|
||||
Requires: click, Markdown, PyYAML, Jinja2, tornado, lunr, livereload
|
||||
```
|
||||
|
||||
#### Vérifier les paquets installés:
|
||||
|
||||
```bash
|
||||
$ pip3 check
|
||||
mkdocs 1.1.2 has requirement lunr[languages]==0.5.8, but you have lunr 0.5.9.
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### pipdeptree:
|
||||
@@ -474,3 +505,11 @@ mkdocs==1.1
|
||||
- tornado [required: >=5.0, installed: 6.0.4]
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Configuration:
|
||||
|
||||
```bash
|
||||
$ pip3 config edit
|
||||
```
|
||||
|
||||
|
||||
@@ -42,7 +42,31 @@ $ python3 -m site --user-base
|
||||
/Users/bruno/Library/Python/3.7
|
||||
```
|
||||
|
||||
[Pipenv](https://docs.pipenv.org)
|
||||
|
||||
|
||||
### Pipenv
|
||||
|
||||
#### Outil qui remplace pip et virtualenv
|
||||
|
||||
https://github.com/pypa/pipenv
|
||||
|
||||
[Docs](https://pipenv.pypa.io/en/latest/)
|
||||
|
||||
|
||||
|
||||
### Pyenv
|
||||
|
||||
#### Python Version Management
|
||||
|
||||
https://github.com/pyenv/pyenv
|
||||
|
||||
|
||||
|
||||
### Venv (Pyvenv)
|
||||
|
||||
#### Outil pour créer un environnement virtuel
|
||||
|
||||
Fournit avec Python (>= 3.4). Similaire à virtualenv.
|
||||
|
||||
|
||||
|
||||
@@ -249,3 +273,35 @@ sudo mkdir /usr/local/Frameworks
|
||||
sudo chown $(whoami):admin /usr/local/Frameworks
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Python@39: Error: The brew link step did not complete successfully
|
||||
|
||||
```bash
|
||||
==> Pouring python@3.9-3.9.1_4.big_sur.bottle.tar.gz
|
||||
Error: The `brew link` step did not complete successfully
|
||||
The formula built, but is not symlinked into /usr/local
|
||||
Could not symlink bin/easy_install-3.9
|
||||
Target /usr/local/bin/easy_install-3.9
|
||||
already exists. You may want to remove it:
|
||||
rm '/usr/local/bin/easy_install-3.9'
|
||||
|
||||
To force the link and overwrite all conflicting files:
|
||||
brew link --overwrite python@3.9
|
||||
|
||||
To list all files that would be deleted:
|
||||
brew link --overwrite --dry-run python@3.9
|
||||
|
||||
Possible conflicting files are:
|
||||
/usr/local/bin/easy_install-3.9
|
||||
/usr/local/bin/pip3
|
||||
/usr/local/bin/pip3.9
|
||||
```
|
||||
|
||||
```bash
|
||||
$ brew link --overwrite --dry-run python@3.9
|
||||
# puis
|
||||
$ rm '/usr/local/bin/easy_install-3.9'
|
||||
$ brew link --overwrite python@3.9
|
||||
```
|
||||
|
||||
|
||||
@@ -153,3 +153,23 @@ cd myproject
|
||||
pipenv install requests
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
```bash
|
||||
~/venv master* ⇡
|
||||
❯ python3 -m venv rpd
|
||||
|
||||
> cd rpd
|
||||
|
||||
❯ bin/pip3 install -U pip setuptools
|
||||
|
||||
❯ cp /Users/bruno/Downloads/install.py /Users/bruno/Documents/venv/rpd
|
||||
|
||||
|
||||
|
||||
❯ source bin/activate
|
||||
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user