forked from lukecyca/pyzabbix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (43 loc) · 1.11 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
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 .
release:
./scripts/release.sh
changelog:
git-chglog --output CHANGELOG.md 1.1.0..
if command -v npx > /dev/null; then npx prettier --write CHANGELOG.md; fi
git add CHANGELOG.md
git commit -m "docs: regenerate changelog"
clean:
rm -Rf $(VENV) dist