Add some small info on building python packages
This commit is contained in:
parent
225d6b5aba
commit
46d91e1305
@ -5,6 +5,36 @@ visible: true
|
|||||||
|
|
||||||
[toc]
|
[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
|
## Exit on Keyboard Interrupt
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
Loading…
Reference in New Issue
Block a user