Contributing¶
Everyone is invited to contribute to this project. Feel free to create a pull request . If you find errors, omissions, inconsistencies, or other things that need improvement, please create an issue.
Development Installation¶
Instead of pip-installing the latest release from PyPI, you should get the newest development version from Github:
git clone https://github.com/audeering/audmetric/
cd audmetric
# Install uv
# pip install uv
uv sync
This installs the package in editable mode and includes all development dependencies.
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 --install-hooks
uvx pre-commit run --all-files
Afterwards ruff and codespell are executed every time you create a commit.
You can also call ruff and codespell 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 audmetric/ tests/
uvx codespell audmetric/ tests/
Building the Documentation¶
If you make changes to the documentation,
you can re-create the HTML pages using Sphinx.
Documentation dependencies are installed automatically
when you run uv sync.
To create the HTML pages, use:
uv run python -m sphinx docs/ build/sphinx/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 python -m sphinx docs/ build/sphinx/html -b linkcheck
Running the Tests¶
You’ll need pytest for that.
Test dependencies are installed automatically
when you run uv sync.
To execute the tests, simply run:
uv run pytest
Creating a New Release¶
New releases are made using the following steps:
Update
CHANGELOG.rstCommit those changes as “Release X.Y.Z”
Create an (annotated) tag with
git tag -a X.Y.ZPush the commit and the tag to Github