Contributing

Standard flow:

  • Fork the repository

  • Create a new branch from main

  • ~ do work ~

  • Open pull request against mio:main

  • Code review and discussion happens

  • Merge contribution

normal i guess.

Norms

  • All new code should be tested if possible. Since this is a hardware interface package, some things may be impossible to test. For any major new hardware functionality, a mock class should be written to isolate software and hardware testing.

  • All modifications to code should be documented: this includes both API documentation in docstrings as well as narrative usage documentation in the docs directory.

Code of Conduct

(forthcoming, for now BDFLs enforce kindness and inclusiveness with their arbitrary and expansive power)

Development Environment

Install using the all extra, which should have all other extras in it

pdm install --with all
# or
pip install '.[all]'

Linting

mio uses black for code formatting and ruff for linting. We recommend you configure your IDE to do both automatically.

There are a few ways you can run linting manually:

First, just by running the raw commands:

ruff check --fix
black mio

Or using pdm scripts

# check for problems
pdm run lint

# format code & try to resolve linter errors
pdm run format

Or you can use the pre-commit action to automatically run them before committing code:

pre-commit install