The modern way: use pyproject.toml only

Avoid these outdated mechanisms

Sphinx API docs

Note: the most reliable way to have autodoc working is to install the package in question in the environment where Sphinx is executed

  1. Set up Sphinx:

    sphinx-quickstart docs

  2. In docs/conf.py, add the sphinx.ext.autodoc extension

  3. Add docs/api.rst:

    API reference
    =============
    
    .. automodule:: goeiedag
       :imported-members:
       :members:
       :undoc-members:
    
  4. Add api to toctree in docs/index.rst

Publishing on Read the Docs

  1. Sign up on https://about.readthedocs.com/
  2. Import a project
  3. Add and adjust the .readthedocs.yaml file as per the wizard

Examples:

Releasing to PyPI

Prerequisities: the packages build and twine

  • update CHANGELOG.md and version in pyproject.toml

  • execute the following commands

    mkdir -p dist
    rm dist/*.tar.gz dist/*.whl
    python -m build
    python -m twine upload --repository testpypi dist/*       # either
    python -m twine upload dist/*                             # or