* ci: tighten pre-commit guardrails Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com> * ci: validate pre-commit guardrail changes Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com> * ci: switch hook validation to prek Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com> * ci: exempt active slim plan from max-lines Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com> * ci: move max-lines config under github Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com> * ci: fail on uncovered tach modules Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com> * ci: ignore generated docs in max-lines check Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com> * ci: clarify local validation tasks Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com> * docs: refine agent instructions Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com> * ci: replace mypy with ty (cherry picked from commit 382afbde8f00abfaeba95ea9c8e9cc603f27a2d9) Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com> * ci: replace justfile with makefile Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com> --------- Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>
2.8 KiB
Contributing In General
Our project welcomes external contributions. If you have an itch, please feel free to scratch it.
For more details on the contributing guidelines head to the Docling Project community repository.
Developing
Usage of uv
We use uv as package and project manager.
Installation
To install uv, check the documentation on Installing uv.
Create an environment and sync it
You can use the uv sync to create a project virtual environment (if it does not already exist) and sync
the project's dependencies with the environment.
uv sync
Use a specific Python version (optional)
If you need to work with a specific version of Python, you can create a new virtual environment for that version and run the sync command:
uv venv --python 3.12
uv sync
More detailed options are described on the Using Python environments documentation.
Add a new dependency
Simply use the uv add command. The pyproject.toml and uv.lock files will be updated.
uv add [OPTIONS] <PACKAGES|--requirements <REQUIREMENTS>>
Coding Style Guidelines
We use the following tools to enforce code style:
A set of styling checks, as well as regression tests, are defined and managed through prek, a fast runner for pre-commit-compatible hook configs.
To ensure that those scripts run automatically before a commit is finalized, install prek on your local repository:
uv run prek install
To run the checks on-demand, run:
uv run prek run --all-files
Note: Checks like Ruff will "fail" if they modify files. This is because hook runners don't like to see files modified by their hooks. In these cases, git add the modified files and git commit again.
Tests
When submitting a new feature or fix, please consider adding a short test for it.
Reference test documents
When a change improves the conversion results, multiple reference documents must be regenerated and reviewed.
The reference data can be regenerated with
DOCLING_GEN_TEST_DATA=1 uv run pytest
All PRs modifying the reference test data require a double review to guarantee we don't miss edge cases.
Documentation
We use MkDocs to write documentation.
To run the documentation server, run:
mkdocs serve
The server will be available at http://localhost:8000.
Pushing Documentation to GitHub Pages
Run the following:
mkdocs gh-deploy