File: Makefile

package info (click to toggle)
pyzabbix 1.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 184 kB
  • sloc: python: 903; makefile: 45
file content (48 lines) | stat: -rw-r--r-- 909 bytes parent folder | download
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