Development
Tests
Note: Running the tests (successfully) requires that
you connected a STU to your test system,
at least one sensor device (e.g. STH) is available
the sensor device has support for changing the sensor configuration (mapping sensor channels to measurement channels)
In the text below we assume that you installed
To run the tests run the following command:
just test
Guidelines
These guidelines are a work-in-progress and aim to explain development decisions and support consistency.
Logging
The application is set up to log everything. This is how the logging is set up.
Guidelines
Log only after success
Don’t log intent, like “Creating user…” or “Initializing widget…” unless it’s for debugging.
Do log outcomes, like “User created successfully.” — but only after the operation completes without error.
Avoid logging in constructors unless they cannot fail
Prefer logging in methods that complete the actual operation,
or use a factory method to wrap creation and success logging.
Levels
Action |
Log Level |
Description (taken from Python docs) |
|---|---|---|
Starting a process / intention |
|
Detailed information for diagnosing problems. Mostly useful for developers. |
Successfully completed action |
|
For confirming that things are working as expected. |
Recoverable error / edge case |
|
Indicates something unexpected happened or could cause problems later. |
Expected failure / validation |
|
Used for serious problems that caused a function to fail. |
Critical Failure / unrecoverable |
|
For very serious errors. Indicates a critical condition — program may abort. |
Unexpected exception (with trace) |
|
Serious errors, but the exception was caught. |
Release
Note: In the text below we assume that you want to release version <VERSION> of the package. Please just replace this version number with the version that you want to release (e.g. 0.2.0).
Make sure that all the checks and tests work correctly locally
just
Make sure all workflows of the CI system work correctly
Release a new version on PyPI:
just release <VERSION>
Open the release notes for the latest version and create a new release
Paste them into the main text of the release web page
Insert the version number into the tag field
For the release title use “Version
”, where <VERSION>specifies the version number (e.g. “Version 0.2”)Click on “Publish Release”
Note: Alternatively you can also use the
ghcommand:gh release create
to create the release notes.