From 25fed3edddd614aff6920f7f92aae968cc09fb35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Borgna?= <121866228+aborgna-q@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:11:38 +0100 Subject: [PATCH] chore: add a justfile (#389) Similar to other hugrverse projects --- justfile | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 justfile diff --git a/justfile b/justfile new file mode 100644 index 00000000..de7c7aa7 --- /dev/null +++ b/justfile @@ -0,0 +1,37 @@ +# List the available commands +help: + @just --list --justfile {{justfile()}} + +# Prepare the environment for development, installing all the dependencies and +# setting up the pre-commit hooks. +setup: + poetry install + [[ -n "${JUST_INHIBIT_GIT_HOOKS:-}" ]] || poetry run pre-commit install -t pre-commit + +# Run the pre-commit checks. +check: + poetry run pre-commit run --all-files + +# Run all the tests. +test: + poetry run pytest + +# Auto-fix all clippy warnings. +fix: + poetry run ruff check --fix guppylang + +# Format the code. +format: + poetry run ruff format guppylang + +# Generate a test coverage report. +coverage: + poetry run pytest --cov=./ --cov-report=html + +# Load a shell with all the dependencies installed +shell: + poetry shell + + +build-py-docs: + cd hugr-py/docs && ./build.sh