Use pytest
to run the tests in the tests directory:
virtualenv -p /usr/bin/python3 venv
. venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-dev.txt
pytest
Only unit tests:
pytest -m "not integration"
Only integration tests:
pytest -m integration
All tests:
pytest
All tests with code coverage:
pytest --cov=dinglehopper --cov-report=html
Static code analysis:
pytest -k "not test" --mypy
pytest -k "not test" --ruff
This project optionally uses pre-commit to check commits. To use it:
- Install pre-commit, e.g.
pip install -r requirements-dev.txt
- Install the repo-local git hooks:
pre-commit install
- Update
ocrd-tool.json
git commit
git tag vx.y.z
git push && git push --tags
- The GitHub Actions workflow
release
will now create a. a new release on GitHub and b. a new release on PyPI - Currently requires a review for PYPI?