Contributing and Development

Thank you for your interest in improving this project. This project is open-source under the MIT license and welcomes contributions in the form of bug reports, feature requests, and pull requests.

Here is a list of important resources for contributors:

Tooling in use

  • Poetry for dependency management.

  • Nox for running tests, building docs, etc.

  • GitHub Actions for CI/CD and building the GitHub Pages documentation site.

  • Sphinx for writing the documentation in rST, mainly chosen for its excellent support for auto-generating Python API docs.

  • pre-commit for faster feedback on your changes.

How to set up your development environment

You need Python 3.12+ and the following tools:

Install the package with development requirements:

$ python3 -mvenv venv
$ source venv/bin/activate
$ pip install poetry
$ poetry install

Finally, install and set up pre-commit:

$ nox --session=pre-commit -- install

Running Locally

$ mac-server --debug

The app will now be available at http://127.0.0.1:5000

How to test the project

Run the full test suite:

$ nox

List the available Nox sessions:

$ nox --list-sessions

You can also run a specific Nox session. For example, invoke the unit test suite like this:

$ nox --session=tests

To manually run the pre-commit tests:

$ nox --session=pre-commit

Unit tests are located in the tests/ directory, and are written using the pytest testing framework.

How to build docs

To build docs, serve them locally, and rebuild as they change:

$ DOCS_REBUILD=true nox --session=docs

To just build docs to docs/build/:

$ nox --session=docs

How to submit changes

Open a pull request to submit changes to this project.

Your pull request needs to meet the following guidelines for acceptance:

  • The Nox test suite must pass without errors and warnings.

  • Include unit tests. This project maintains 100% code coverage.

  • If your changes add functionality, update the documentation accordingly.

Feel free to submit early, though—we can always iterate on this.

To run linting and code formatting checks before committing your change, you can install pre-commit as a Git hook by running the following command:

$ nox --session=pre-commit -- install

It is recommended to open an issue before starting work on anything. This will allow a chance to talk it over with the owners and validate your approach.

Release Process

Use poetry version to increment the version number, commit push and merge that. Tag the repo and push the tag. GitHub Actions will run a Docker build, push to GHCR (GitHub Container Registry), build to PyPI, and create a release on the repo.