formations/python-avancé/5-packaging.md

49 lines
553 B
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Le packaging
## Petite parenthèse
La différence entre un paquet et un module ?
Notes:
Pour Python il n'y en a pas, tout est module, pour nous, un paquet est
un dossier. Aborder rapidement les paquets-espace-de-noms.
## Digression
`__main__` et `__main__.py`.
## venv
Notes:
Et ses alternatives : virtualenv / conda.
## pip
Notes:
Jamais `sudo`, toujours dans un `venv`.
## pyproject.toml
## pip install .
## Packager
```bash
pip install build
python -m build
```
### Publier
```bash
pip install twine
twine upload dist/*
```