-
Notifications
You must be signed in to change notification settings - Fork 314
/
Copy pathMakefile
48 lines (36 loc) · 909 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
43
44
45
46
47
48
all: lint test
.DEFAULT_GOAL: install
SHELL = bash
CPU_CORES = $(shell N=$$(nproc); echo $$(( $$N > 4 ? 4 : $$N )))
VENV = .venv
$(VENV):
python3 -m venv $(VENV)
$(MAKE) install
install: $(VENV)
$(VENV)/bin/pip install --upgrade pip setuptools wheel build
$(VENV)/bin/pip install --editable .[dev]
format: $(VENV)
$(VENV)/bin/black .
$(VENV)/bin/isort .
lint: $(VENV)
$(VENV)/bin/black . --check
$(VENV)/bin/isort . --check
$(VENV)/bin/pylint --jobs=$(CPU_CORES) --output-format=colorized pyzabbix tests
$(VENV)/bin/mypy pyzabbix tests
PYTEST_CMD = $(VENV)/bin/pytest -v \
--numprocesses=$(CPU_CORES) \
--color=yes
test: $(VENV)
$(PYTEST_CMD) \
--cov-config=./pyproject.toml \
--cov-report=term \
--cov-report=xml:./coverage.xml \
--cov=pyzabbix \
tests
.PHONY: e2e
e2e: $(VENV)
$(PYTEST_CMD) e2e
build: $(VENV)
$(VENV)/bin/python -m build .
clean:
rm -Rf $(VENV) dist