Developers' Handbook¶
Documentation Style Guide¶
This project uses a static document tree in docs folder for architecture, roadmap, a.s.o
and collocated/integrated documentation for the python packages. For best results the
code documentation shall follow the
google style guide for python.
We use MKDocstrings and zensical as build-tool for the static documentation. The following hints may help to get the best results:
- keep file header short (see Source File Headers)
- put effort in the class description, this will appear in the docs
- the documentation of the constructor
__init__will be merged to the class - private and dunder methods are not included in the docs
- use Markdown links, e.g.
[OPCUACommunicationObject][mtppy.part5.communication_object.OPCUACommunicationObject]instead of sphinx roles
Source File Headers¶
MTPPy2.0 is published under the MIT License. This shall be documented in all files with the following standard header
"""Purpose of this file in one short sentence, terminated with dot ."""
__copyright__ = (
"Copyright (c) 2026 Dresden University of Technology, Process-to-Order Group"
)
__license__ = "MIT"
Python Project Tooling¶
Package management: uv¶
uv is a fast and modern Python package manager that simplifies dependency management and project setup. It supports adding both runtime and development dependencies, locking versions, and managing virtual environments.
To add a runtime dependency:
To add a development dependency (e.g., tools used only during development such as pytest, setuptools, a.s.o) we make use of a dev-group in uv:
Linting : ruff¶
Our tool of choice is ruff. You will find the project wide excluded rules
in pyproject.toml in the section [tool.ruff].
We try to hold the ignore-list as short as possible. Currently, developer has to do the actual linting individually. However, we might want to add this to CI/CD with milestone PREVIEW.
Testing: pytest¶
pytest is added as a development dependency. Run tests using uv to ensure the correct environment is used.
Collocated unit tests¶
The unit tests are collocated in ./src and shall follow the filename scheme <unit-under-test>_test.py
Systems and integration tests¶
system and integration tests reside in ./tests.
Configuration¶
The intention of colocated unit tests and separate system tests is reflected in pyproject.toml with the line
.coveragerc file