Contributing

If you find errors, omissions, inconsistencies, or other things that need improvement, please create an issue. If you would like to add new functionality create a merge request . Contributions are always welcome!

Development Installation

Instead of installing the latest release from PyPI with pip, you should get the newest development version from Github:

git clone git@github.com:audeering/sphinx-apipages.git
cd sphinx-apipages

This way, your installation always stays up-to-date, even if you pull new changes from the Gitlab repository.

Coding Convention

We follow the PEP8 convention for Python code and use ruff as a linter and code formatter. In addition, we check for common spelling errors with codespell. Both tools and possible exceptions are defined in pyproject.toml.

The checks are executed in the CI using pre-commit. You can enable those checks locally by executing:

uvx pre-commit install
uvx pre-commit run --all-files

Afterwards ruff and codespell are executed every time you create a commit.

You can also install ruff and codespell and call it directly:

uvx ruff check --fix .  # lint all Python files, and fix any fixable errors
uvx ruff format .  # format code of all Python files
uvx codespell

It can be restricted to specific folders:

uvx ruff check sphinx-apipages/ tests/
uvx codespell sphinx-apipages/ tests/

Building the Documentation

If you make changes to the documentation, you can re-create the HTML pages using Sphinx. To create the HTML pages, use:

uv run sphinx-build docs/ build/html -b html

The generated files will be available in the directory build/sphinx/html/.

It is also possible to automatically check if all links are still valid:

uv run sphinx-build docs/ build/linkcheck -b linkcheck

Running the Tests

To execute the tests, simply run:

uv run pytest

pytest is configured inside pyproject.toml.

Creating a New Release

New releases are made using the following steps:

  1. Update CHANGELOG.rst

  2. Commit those changes as “Release X.Y.Z” with a pull request

  3. Create an (annotated) tag with git tag -a vX.Y.Z

  4. Push the commit and the tag to Gitlab