We use uv and docker for local development.
-
Install
uvby following the uv installation instructions. -
Install
dockerby following the Docker installation instructions. -
Install all dependencies:
$ uv sync --all-groups Resolved 234 packages in 1ms Audited 225 packages in 0.42ms
-
Install the pre-commit hooks:
$ uv run pre-commit install pre-commit installed at .git/hooks/pre-commit
Tip
Run make help for a list of all available Make commands.
All code quality checks are run through make. These same checks run in CI on every pull request.
| Command | Description |
|---|---|
make format |
Auto-format code with ruff format and fix lint violations with ruff check --fix. |
make lint |
Check formatting and lint rules without making changes (used in CI). |
make ty |
Run ty for static type checking across optimuskg/ and cli/. |
make interrogate |
Check docstring coverage against the threshold defined in pyproject.toml. |
Every pull request must pass three checks before merging:
- Type checking and docstring coverage —
make tyandmake interrogatemust pass. - Formatting —
make lintand spell checking withtyposmust pass. Runmake formatlocally to fix issues before pushing. - Semver bump — the
versionfield inpyproject.tomlmust be incremented on every PR. The CI job compares the version between the PR branch andmainand fails if it has not changed.
Tests use pytest and are run through hatch to pick up the pre-configured flags in pyproject.toml:
$ uv tool run hatch run pytestThe pipeline ships a Typer-based CLI for common maintenance tasks:
$ uv run cli --helpFor ParquetDataset entries the command reads the Parquet file on disk and updates the YAML schema specification. For any dataset with a metadata.checksum field it recomputes the BLAKE2b checksum and updates the catalog YAML (using regex replacement to preserve formatting, comments, and OmegaConf syntax).
# Sync all schemas and checksums
$ uv run cli sync-catalog
# Preview changes without writing files
$ uv run cli sync-catalog --dry-run
# Validate without updating (useful in CI)
$ uv run cli sync-catalog --validate
# Target a specific layer
$ uv run cli sync-catalog --layer bronze
# Target a specific dataset
$ uv run cli sync-catalog --dataset bronze.opentargets.disease| Option | Short | Description |
|---|---|---|
--layer |
-l |
Target layer: landing, bronze, silver, or all (default: all). |
--dataset |
-d |
Specific dataset name (e.g., bronze.opentargets.disease). |
--validate |
-v |
Validate schemas and checksums without updating files. |
--dry-run |
-n |
Preview changes without writing files. |
--catalog-dir |
Path to the catalog directory (default: conf/base/catalog). |
|
--data-dir |
Path to the data directory (default: data). |
The OptimusKG data pipeline enforces strict synchronization between node files and catalog YAML files. When you edit any Python node file under optimuskg/pipelines/*/nodes/, you must also update the corresponding catalog entries and rerun all downstream nodes.
- Identify the catalog entries affected by your change in
conf/base/catalog/. - Update the dataset ID, filepath, or schema as needed.
- Rerun the node and sync the catalog:
$ uv run kedro run --from-nodes=<node_name> $ uv run cli sync-catalog --dataset <catalog_id>
- Cascade downstream — rerun all nodes that depend on the changed output.
Important
Never delete the checksum field from a catalog entry. If the output of a node changes, recompute it with uv run cli sync-catalog --dataset <catalog_id>.