diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 747fc4e..a345ab0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-merge-conflict - id: check-toml diff --git a/Makefile b/Makefile index 5ae35c8..687b837 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,31 @@ +.PHONY: help +help: + @echo "Make targets for Gafaelfawr" + @echo "make init - Set up dev environment" + @echo "make run - Run development instance of server" + @echo "make update - Update pinned dependencies and run make init" + @echo "make update-deps - Update pinned dependencies" + @echo "make update-deps-no-hashes - Pin dependencies without hashes" + +.PHONY: init +init: + pip install --upgrade pip + pip install --upgrade pre-commit tox + pip install --editable . + pip install --upgrade -r requirements/main.txt -r requirements/dev.txt + rm -rf .tox + pre-commit install + +.PHONY: update +update: update-deps init + # The dependencies need --allow-unsafe because pre-commit transitively # depends on setuptools, which is normally not allowed to appear in a hashed # dependency file. .PHONY: update-deps update-deps: + pip install --upgrade pre-commit + pre-commit autoupdate pip install --upgrade pip-tools pip setuptools pip-compile --upgrade --resolver=backtracking --build-isolation \ --allow-unsafe --generate-hashes \ @@ -22,17 +45,6 @@ update-deps-no-hashes: --allow-unsafe \ --output-file requirements/dev.txt requirements/dev.in -.PHONY: init -init: - pip install --editable . - pip install --upgrade -r requirements/main.txt -r requirements/dev.txt - rm -rf .tox - pip install --upgrade tox - pre-commit install - -.PHONY: update -update: update-deps init - .PHONY: run run: tox -e run