Skip to content

Commit

Permalink
Add package build and upload instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
hackdna committed Nov 21, 2024
1 parent 7d960ec commit 2f5d080
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/source/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,23 @@ Open `docs/_build/html/index.html` in a web browser to check the results
* Use the [logging module](https://docs.python.org/3/library/logging.html) instead of `print()`
* [Formatting log messages](http://reinout.vanrees.org/weblog/2015/06/05/logging-formatting.html): `logger.info("%s went %s wrong", 42, 'very')`
* Continue writing code and comments all the way until the end of the line then indent appropriately
* [Packaging Python Projects](https://packaging.python.org/en/latest/tutorials/packaging-projects)

### Packaging and distribution

#### Python Package Index
* Use [TestPyPI](https://test.pypi.org/) for testing that your package can be uploaded, downloaded, and installed correctly
* [Register an account](https://test.pypi.org/account/register/)
* [Create an API token](https://test.pypi.org/manage/account/#api-tokens) (setting the "Scope" to "Entire account")
* [Add API token](https://packaging.python.org/en/latest/specifications/pypirc/#using-a-pypi-token) to your `$HOME/.pypirc` file
* Generate distribution archives: `python -m build`
* Check the results: `twine check dist/*`
* Upload distribution archives:
* TestPyPI: `twine upload --repository testpypi dist/*`
* PyPI: `twine upload dist/*`
* Install from TestPyPI to verify:
* TestPyPI: `pip install --index-url https://test.pypi.org/simple/ --no-deps forest-analysis`
* PyPI: `pip install forest-analysis`

## GitHub

Expand Down

0 comments on commit 2f5d080

Please sign in to comment.