Developer Guide

Versioning Scheme

bpod-core uses Semantic Versioning. Its version string (currently 0.1.0-alpha) is a combination of three fields, separated by dots:

MAJOR . MINOR . PATCH

  • The MAJOR field is only incremented for breaking changes, i.e., changes that are not backward compatible with previous changes.

  • The MINOR field will be incremented upon adding new, backward compatible features.

  • The PATCH field will be incremented with each new, backward compatible bugfix release that does not implement a new feature.

On the developer side, these 3 fields are manually controlled by, both

  1. adjusting the variable __version__ in bpod-core/__init__.py, and

  2. adding the corresponding version string to a commit as a git tag, for instance:

    git tag 1.2.3
    git push origin --tags
    

Package Management and Development Workflows with PDM

We use PDM to manage dependencies of bpod-core. PDM can also be used to run various commands with relevance to the development process without having to activate a virtual environment first. Please refer to PDM’s documentation for help with installing PDM.

Installing Developer Dependencies

To install additional dependencies needed for working on bpod-core’s code-base, run:

pdm sync -d

Running Unit Tests

To run unit tests locally, run:

pdm run pytest

This will also generate a HTML based coverage report which can be found in the htmlcov directory.

Linting & Formatting

We use Ruff for linting and formatting our code-base in close accordance with the Black code style.

To lint your code, run:

pdm run ruff check

Appending the flag --fix to the above command will automatically fix issues that are deemed safe to handle.

To reformat your code according to the Black code style run:

pdm run ruff format

Appending the flag --check to the above command will check your code for formatting issues without applying any changes. Refer to Ruff Formater’s documentation for further details.

Documentation

To build the documentation, run:

pdm run docs