Created
April 18, 2024 10:54
-
-
Save ogvalt/932644a3394d44795bc86c4c48696a78 to your computer and use it in GitHub Desktop.
This is my standard taskfile for my python projects. Pre-commit, poetry, mypy, pytest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
dotenv: ['.env'] | |
tasks: | |
setup: | |
desc: Setup development environment | |
cmds: | |
- poetry run pre-commit install | |
- poetry run pre-commit install --hook-type commit-msg | |
- poetry install | |
lint: | |
desc: Run pre-commit manually | |
cmds: | |
- poetry run pre-commit run --all-files | |
mypy: | |
desc: Run mypy | |
cmds: | |
- poetry run pre-commit run --all-files mypy | |
test: | |
desc: Run tests | |
cmds: | |
- poetry run pytest -v --show-capture=all | |
coverage: | |
desc: Run coverage | |
cmds: | |
- poetry run pytest -v --junitxml=report.xml --cov="inference_sdk" --cov-fail-under=$COVERAGE_THRESHOLD . | |
clean-cache: | |
desc: Clean python, pytest, ruff, mypy caches | |
cmds: | |
- find . ! -path "*/.venv/*" -name "__pycache__" -exec rm -rv {} + | |
- find . -name ".pytest_cache" -exec rm -rv {} + | |
- find . -name ".ruff_cache" -exec rm -rv {} + | |
- find . -name ".mypy_cache" -exec rm -rv {} + | |
- find . -name ".coverage" -exec rm -rv {} + | |
- find . -name "report.xml" -exec rm -rv {} + | |
clean: | |
desc: Clean all | |
deps: [clean-cache] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment