Contributing#

Contributions are welcome! If you would like to contribute to autrainer, please open an issue or a pull request on the GitHub repository.

Installation#

It is recommended to install autrainer within a virtual environment. To create a new virtual environment, refer to the Python venv documentation.

To set up autrainer for development, start by cloning the repository and then install the development dependencies with uv:

git clone git@github.com:autrainer/autrainer.git
cd autrainer
uv sync --all-extras --all-groups --inexact

Note

If you are using Windows, make sure that PyTorch (along with torchvision and torchaudio) version 2.0 or higher is installed beforehand. For installation instructions, refer to the PyTorch documentation.

The --inexact flag allows for manual installation of a specific PyTorch version prior to syncing dependencies. This is necessary because autrainer does not pin a PyTorch version for Windows to not conflict with different CUDA versions.

Conventions#

We use Ruff to enforce code style and formatting. Common spelling errors are automatically corrected by codespell.

Linting, formatting, and spelling checks are run with pre-commit. To install the pre-commit hooks, run the following command:

pre-commit install

Tests#

We use pytest for testing. To run the tests, use the following command:

pytest