-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (42 loc) · 1.72 KB
/
Copy pathMakefile
File metadata and controls
56 lines (42 loc) · 1.72 KB
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
PYTHON := python
PYLINT := pylint
PYRIGHT := pyright
PYTHONPATH := src
PYLINTHOME := $(CURDIR)/.cache/pylint
.PHONY: help test test-unittest test-pytest test-root test-podman-root test-integration lint typecheck check clean all
help:
@printf '%s\n' \
'Available targets:' \
' make test-unittest Run the unittest suite' \
' make test-pytest Run the pytest suite' \
' make test-root Run local Linux tests that require root' \
' make test-podman-root Run root tests in a rootless Podman user namespace' \
' make test-integration Run large-scale tests on configured real filesystems' \
' make test Run both test suites' \
' make lint Run pylint to lint' \
' make typecheck Run pyright to typecheck' \
' make check Run test, lint, and typecheck' \
' make all Alias for make check' \
' make clean Delete Python and tool caches'
all: check
test: test-unittest test-pytest
test-unittest:
PYTHONHASHSEED=0 PYTHONPATH=$(PYTHONPATH) $(PYTHON) -m pytest -q tests/unittests
test-pytest:
PYTHONHASHSEED=0 PYTHONPATH=$(PYTHONPATH) $(PYTHON) -m pytest -q tests/pytests
test-root:
PYTHONHASHSEED=0 PYTHONPATH=$(PYTHONPATH) $(PYTHON) -m pytest -q tests/root
test-podman-root:
+podman unshare $(MAKE) test-root
test-integration:
PYTHONHASHSEED=0 PYTHONPATH=$(PYTHONPATH) $(PYTHON) -m pytest -q tests/integration
lint:
PYTHONPATH=$(PYTHONPATH) PYLINTHOME=$(PYLINTHOME) $(PYLINT) src tests
typecheck:
$(PYRIGHT)
$(PYRIGHT) --project tests/pyrightconfig.json
check: test lint typecheck
clean:
find . -type f \( -name '*.pyc' -o -name '*.pyo' \) -delete
find . -depth -type d -name __pycache__ -exec rmdir {} +
rm -rf .cache .pytest_cache .mypy_cache .pyright .ruff_cache