Packager avant tox, car tox a vite besoin d'un paquet

This commit is contained in:
Julien Palard 2022-09-23 15:04:16 +02:00
parent 437c45523e
commit f50a1a896f
Signed by: mdk
GPG Key ID: 0EFC1AC1006886F8
1 changed files with 60 additions and 60 deletions

View File

@ -1341,6 +1341,51 @@ $ conda activate test
```
# Le packaging
## Le packaging
Restez dans les standards : `pyproject.toml`, `setup.cfg`.
## pyproject.toml et setup.cfg
- https://github.com/JulienPalard/oeis
- https://setuptools.readthedocs.io/
## pip
```bash
(test) $ pip install .
```
## pytest
```bash
(test) $ mkdir tests/
(test) $ pip install pytest
(test) $ editor tests/test_dice.py
```
Notes: C'est l'occasion de parler de assert.
## hypothesis
```python
from hypothesis import given
from hypothesis.strategies import integers
@given(integers(min_value=2,
max_value=1000))
def test_fib(i):
assert fib(i) == fib(i-1) + fib(i-2)
```
# Les bonnes pratiques
Notes: Prérequis: pip et venv.
@ -1451,6 +1496,21 @@ Permet de lancer les tests:
Notes: c.f. gh/JulienPalard/oeis.
## pdb
```
breakpoint()
```
## PYTHONDEVMODE=y
Et `./configure --with-pydebug`.
Notes: Voir mon bashrc :] Surtout "viable" depuis la 3.8.
# `*`, `**`
@ -1575,66 +1635,6 @@ que latin-1 et companie sont à taille fixe, et qu'UTF-8 est à taille
variable.
# Le packaging
## Le packaging
Restez dans les standards : `pyproject.toml`, `setup.cfg`.
## pyproject.toml et setup.cfg
- https://github.com/JulienPalard/oeis
- https://setuptools.readthedocs.io/
## pip
```bash
(test) $ pip install .
```
## pytest
```bash
(test) $ mkdir tests/
(test) $ pip install pytest
(test) $ editor tests/test_dice.py
```
Notes: C'est l'occasion de parler de assert.
## hypothesis
```python
from hypothesis import given
from hypothesis.strategies import integers
@given(integers(min_value=2,
max_value=1000))
def test_fib(i):
assert fib(i) == fib(i-1) + fib(i-2)
```
## pdb
```
breakpoint()
```
## PYTHONDEVMODE=y
Et `./configure --with-pydebug`.
Notes: Voir mon bashrc :] Surtout "viable" depuis la 3.8.
# Les modules utiles
- argparse