Skip to content

Development setup

You need Python 3.12 or newer, Git and uv.

Terminal window
git clone https://github.com/beatrice-b-m/dicom-standard-kb.git
cd dicom-standard-kb
make install
make check

make install installs the locked runtime, MCP and development dependencies. make check runs Ruff, strict mypy and the offline unit tests. make format applies the shared formatting.

The unit tests under tests/unit/ use synthetic DocBook fixtures and temporary databases. Run one file while iterating:

Terminal window
uv run --frozen --all-extras --dev pytest tests/unit/test_query_resolver.py

To try commands by hand, build the synthetic fixture:

Terminal window
uv run dicom-kb build-fixture --cache-dir /tmp/dicom-kb-fixture --db /tmp/dicom-kb-fixture.sqlite --force
uv run dicom-kb iod "CT Image" --db /tmp/dicom-kb-fixture.sqlite

The integration tests run against a knowledge base built from the current NEMA edition:

Terminal window
uv run dicom-kb fetch
uv run dicom-kb build
make test-integration

They use the newest build in the cache, or the edition named by DICOM_KB_TEST_EDITION.

Keep downloaded sources and databases outside the repository; the default cache is ~/.cache/dicom-standard-kb.