-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (47 loc) · 2.07 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
63
64
65
66
mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
EXTRA_PIP_COMPILE_ARGS ?=
.PHONY: check-% clean install install-% run-% update-%
.venv/:
python3.12 -m venv .venv/
build:
pip install build==1.*
# Setting SOURCE_DATE_EPOCH to commit date,
# so that build produces whl with reproducable hash given same source-code,
# resulting in reproducable builds that don't result in hash mismatches on rebuild
REF=$$(git log -n 1 --no-merges --format=%H -- ./pavi_shared_aws/ pyproject.toml) && \
echo "REF: $$REF" && \
export SOURCE_DATE_EPOCH=$$(git show --no-patch --format=%ct $$REF) && \
echo "SOURCE_DATE_EPOCH: $$SOURCE_DATE_EPOCH" && \
python3.12 -m build
pip hash dist/pavi_shared_aws-0.0.0-py3-none-any.whl
install:
cp dist/pavi_shared_aws-0.0.0-py3-none-any.whl /tmp/
clean:
rm -rf build/ || true
rm dist/* || true
requirements.txt:
@$(MAKE) --no-print-directory -f $(mkfile_dir)/../../Makefile -C $(mkfile_dir) requirements.txt
tests/requirements.txt:
@$(MAKE) --no-print-directory -f $(mkfile_dir)/../../Makefile -C $(mkfile_dir) tests/requirements.txt
update-deps-lock:
@$(MAKE) --no-print-directory -f $(mkfile_dir)/../../Makefile -C $(mkfile_dir) update-python-deps-lock
update-test-deps-lock:
@$(MAKE) --no-print-directory -f $(mkfile_dir)/../../Makefile -C $(mkfile_dir) update-python-test-deps-lock
update-deps-locks-all: update-deps-lock update-test-deps-lock
@:
install-deps:
@$(MAKE) --no-print-directory -f $(mkfile_dir)/../../Makefile -C $(mkfile_dir) install-python-deps
install-test-deps:
@$(MAKE) --no-print-directory -f $(mkfile_dir)/../../Makefile -C $(mkfile_dir) install-python-test-deps
install-deps-update-dev: update-deps-lock install-deps
@:
install-test-deps-update-dev: update-test-deps-lock install-test-deps
@:
run-unit-tests: .venv/ install-test-deps
.venv/bin/python -m pytest
run-unit-tests-dev: .venv/ install-test-deps
.venv/bin/python -m pytest -v
run-type-checks: .venv/ install-test-deps
.venv/bin/mypy --install-types --non-interactive --warn-unused-config ./
run-style-checks: .venv/ install-test-deps
.venv/bin/flake8 ./