From 46d91e1305f701e523eb39590b302adf45c32d62 Mon Sep 17 00:00:00 2001 From: RealStickman Date: Tue, 7 Mar 2023 17:03:35 +0100 Subject: [PATCH] Add some small info on building python packages --- pages/04.other/python/default.en.md | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/pages/04.other/python/default.en.md b/pages/04.other/python/default.en.md index f441df4..d5746c4 100644 --- a/pages/04.other/python/default.en.md +++ b/pages/04.other/python/default.en.md @@ -5,6 +5,36 @@ visible: true [toc] +## Packaging + +### Building + +If `setup.py` or `pyproject.toml` are properly configured, the command below can be used to build a python package. + +```sh +python -m build +``` + +### Install local package + +Pip can be used to install a local package for testing purposes. + +```sh +pip install dist/{PACKAGE NAME}.whl +``` + +### Push to PyPI + +```sh +python -m twine upload --skip-existing dist/* +``` + +To test packaging stuff, it is recommended to push packages to testpypi instead. + +```sh +python -m twine upload --skip-existing --repository testpypi dist/* +``` + ## Exit on Keyboard Interrupt ```python