Development - Contributing¶
Issues and pull requests are more than welcome: github.com/developmentseed/titiler-cmr/issues
dev install
This project uses uv
to manage the python environment and dependencies.
To install the package for development you can follow these steps:
# install uv
# unix
curl -LsSf https://astral.sh/uv/install.sh | sh
# or windows
# powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
git clone https://github.com/developmentseed/titiler-cmr.git
cd titiler-cmr
uv sync --all-extras
Linting¶
This repo is set to use pre-commit
to run isort, flake8, pydocstring, black ("uncompromising Python code formatter") and mypy when committing new code.
uv pre-commit install
Testing¶
You can then run the tests with the following command:
uv run pytest
The tests use vcrpy <https://vcrpy.readthedocs.io/en/latest/>
_ to mock API calls
with "pre-recorded" API responses. When adding new tests that incur actual network traffic,
use the @pytest.mark.vcr
decorator function to indicate vcrpy
should be used.
Record the new responses and commit them to the repository.
uv run pytest -v -s --record-mode new_episodes
Benchmarks¶
tests/test_timeseries_benchmark.py
is used to evaluate the limits of /timeseries
requests.
To run the benchmarks:
uv run pytest -vv --benchmark-only