-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
42 lines (34 loc) · 991 Bytes
/
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
.PHONY: all test setup hooks install linter pytest wheel docs
all: install test
test: linter pytest
LATEST = $(shell git describe --tags $(shell git rev-list --tags --max-count=1))
PWD = $(shell pwd)
setup:
# install meta requirements system-wide
@ echo installing requirements; \
pip --disable-pip-version-check install --force-reinstall -r requirements.txt; \
hooks:
# install pre-commit hooks when not in CI
@ if [ -z "$$CI" ]; then \
pre-commit install; \
fi; \
install: setup hooks
# install packages from lock file in local virtual environment
@ echo installing package; \
pdm install-all; \
linter:
# run the linter hooks from pre-commit on all files
@ echo linting all files; \
pdm lint; \
pytest:
# run the pytest test suite with all unit tests
@ echo running unit tests; \
pdm unit; \
wheel:
# build the python package
@ echo building wheel; \
pdm wheel; \
docs:
# use sphinx to auto-generate html docs from code
@ echo generating docs; \
pdm doc; \