Skip to content

Commit

Permalink
Update Makefile targets
Browse files Browse the repository at this point in the history
Add make help, reorder make init to match other projects, and
have make update-deps also update pre-commit plugins.
  • Loading branch information
rra committed Jan 26, 2024
1 parent f318b57 commit bb2998d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
34 changes: 23 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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 \
Expand All @@ -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

0 comments on commit bb2998d

Please sign in to comment.