* refactor for using uv Signed-off-by: Michele Dolfi <dol@zurich.ibm.com> * fix deprecated classifier Signed-off-by: Michele Dolfi <dol@zurich.ibm.com> * missing uv.lock Signed-off-by: Michele Dolfi <dol@zurich.ibm.com> * move xmltodict to deps Signed-off-by: Michele Dolfi <dol@zurich.ibm.com> --------- Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
2.0 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>>
Code sytle guidelines
We use the following tools to enforce code style:
- isort, to sort imports
- Black, to format code
- MyPy, as static type checker
A set of styling checks, as well as regression tests, are defined and managed through the pre-commit framework. To ensure that those scripts run automatically before a commit is finalized, install pre-commit on your local repository:
uv run pre-commit install
To run the checks on-demand, type:
uv run pre-commit run --all-files
Note: Checks like Black and isort will fail if they modify files. This is because pre-commit doesn't like to see files modified by their hooks. In these cases, git add the modified files and git commit again.