At the project level, the HealthOS provides make
targets for common processes such as creating virtual environments,
executing unit tests, and formatting code.
At the module level, Poetry provides a standard development workflow.
The HealthOS supports the following build targets, which execute against one or modules within the "monorepo":
- package (default): build the HealthOS installation tarball
- wheels: builds a Python wheel
- test: executes pytest unit tests
- format: runs the black formatter against source code, including unit tests
- dev-env: creates local development virtual environments
- clean: removes python bytecode and untracked dependencies from each module.
Build targets will operate on all modules, by default. To override this behavior, set and export the TARGET_MODULES variable.
The example below runs tests for the core
module.
# multiple modules are delimited by a space
export TARGET_MODULES="core"
make test
To add a dependency to a module, execute the following command:
poetry add <dependency name>
Dependencies are updated using poetry. The --dry-run
switch may be used to view updates without making actual changes.
poetry update --dry-run
Executing updates:
# update all project dependencies
poetry update
# update specific dependency
poetry update <dependency>
The LinuxForHealth HealthOS code base uses the black formatter.
poetry run black ./src ./tests
Use pytest to execute unit tests
poetry run pytest
Use isort to clean up the project's imports
poetry run isort .