forked from lsst-sqre/gafaelfawr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (56 loc) · 2.33 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
.PHONY: help
help:
@echo "Make targets for Gafaelfawr"
@echo "make init - Set up dev environment"
@echo "make linkcheck - Check for broken links in documentation"
@echo "make ui - Build the JavaScript frontend"
@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"
# npm dependencies have to be installed for pre-commit eslint to work.
.PHONY: init
init:
pip install --upgrade pip
pip install --upgrade pre-commit tox tox-docker docker
pip install --editable .
pip install --upgrade -r requirements/main.txt -r requirements/dev.txt
rm -rf .tox
pre-commit install
cd ui && npm install --legacy-peer-deps
# This is defined as a Makefile target instead of only a tox command because
# if the command fails we want to cat output.txt, which contains the
# actually useful linkcheck output. tox unfortunately doesn't support this
# level of shell trickery after failed commands.
.PHONY: linkcheck
linkcheck:
sphinx-build --keep-going -n -T -b linkcheck docs \
docs/_build/linkcheck \
|| (cat docs/_build/linkcheck/output.txt; exit 1)
.PHONY: ui
ui:
cd ui && npm run lint:fix
cd ui && npm run build
.PHONY: update
update: update-deps init
# The dependencies need --allow-unsafe because kubernetes-asyncio and
# (transitively) pre-commit depends on setuptools, which is normally not
# allowed to appear in a hashed dependency file.
.PHONY: update-deps
update-deps:
pip install --upgrade pip-tools pip setuptools
pip-compile --upgrade --resolver=backtracking --build-isolation \
--allow-unsafe --generate-hashes \
--output-file requirements/main.txt requirements/main.in
pip-compile --upgrade --resolver=backtracking --build-isolation \
--allow-unsafe --generate-hashes \
--output-file requirements/dev.txt requirements/dev.in
# Useful for testing against a Git version of Safir.
.PHONY: update-deps-no-hashes
update-deps-no-hashes:
pip install --upgrade pip-tools pip setuptools
pip-compile --upgrade --resolver=backtracking --build-isolation \
--allow-unsafe \
--output-file requirements/main.txt requirements/main.in
pip-compile --upgrade --resolver=backtracking --build-isolation \
--allow-unsafe \
--output-file requirements/dev.txt requirements/dev.in