-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (33 loc) · 886 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
49
50
51
52
.SHELL := /bin/bash
package := $(shell pdm show --name)
version := $(shell pdm show --version)
sdist := dist/$(package)-$(version).tar.gz
wheel := dist/$(package)-$(version)-py3-none-any.whl
sources := $(shell find src -type f -print)
tests := $(shell find tests -type f -print)
python_src := $(filter %.py, $(sources) $(tests))
.coverage: $(sources) $(tests)
pdm run coverage run -m tests
.PHONY: test
test: .coverage
coverage-report: .coverage
pdm run coverage html
pdm run python -m webbrowser -t file://$(CURDIR)/htmlcov/index.html
.PHONY: build
build: $(sdist) $(wheel)
$(sdist) $(wheel): $(sources) pyproject.toml
pdm build
pdm.lock: pyproject.toml
pdm lock
.PHONY: lint
lint:
pdm run pylint src tests
pdm run mypy src
clean:
rm -rf .venv build dist __pypackages__
.fmt: $(python_src)
pdm run isort $?
pdm run black $?
touch $@
.PHONY: fmt
fmt: .fmt