-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
94 lines (72 loc) · 2.13 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Copyright (c) 2021 The Toltec Contributors
# SPDX-License-Identifier: MIT
define USAGE
Development:
clean Remove build artifacts.
Testing:
test Run tests.
Building:
build Build the Python package.
standalone Build the standalone toltecmk executable.
Formatting:
format Check that the source code formatting follows
the style guide.
format-fix Automatically reformat the source code to follow
the style guide.
Linting:
lint Perform static analysis on the source code to find
erroneous constructs.
links Check that all links in Markdown files are alive.
endef
export USAGE
help:
@echo "$$USAGE"
.venv-build/bin/activate: requirements.build.txt
@echo "Setting up development virtual env in .venv"
python -m venv .venv-build; \
. .venv-build/bin/activate; \
python -m pip install -r requirements.build.txt
.venv-runtime/bin/activate: requirements.txt
@echo "Setting up development virtual env in .venv"
python -m venv .venv-runtime; \
. .venv-runtime/bin/activate; \
python -m pip install -r requirements.txt
clean:
git clean --force -dX
build: .venv-build/bin/activate
. .venv-build/bin/activate; \
python -m build
standalone: .venv-build/bin/activate
. .venv-build/bin/activate; \
python -m PyInstaller --distpath . toltecmk.spec
test: .venv-runtime/bin/activate
. .venv-runtime/bin/activate; \
python -m unittest; \
tests/foobar/test.sh
format: .venv-build/bin/activate
. .venv-build/bin/activate; \
black --line-length 80 --check --diff toltec tests
format-fix: .venv-build/bin/activate
. .venv-build/bin/activate; \
black --line-length 80 toltec tests
lint: .venv-build/bin/activate
. .venv-build/bin/activate; \
echo "==> Typechecking files"; \
mypy --disallow-untyped-defs toltec; \
echo "==> Linting files"; \
pylint toltec
links:
find . \
-name "*.md" \
-not -exec git check-ignore {} \; \
-exec markdown-link-check {} \;
.PHONY: \
help \
build \
standalone \
clean \
test \
format \
format-fix \
lint \
links