-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
91 lines (74 loc) · 1.52 KB
/
Makefile
File metadata and controls
91 lines (74 loc) · 1.52 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
package_dir := vinted
tests_dir := tests
reports_dir := reports
# ===========
# Environment
# ===========
.PHONY: clean
clean:
rm -rf `find . -name __pycache__`
rm -f `find . -type f -name '*.py[co]'`
rm -f `find . -type f -name '*~'`
rm -f `find . -type f -name '.*~'`
rm -rf `find . -name .pytest_cache`
rm -rf *.egg-info
rm -f report.html
rm -f .coverage
rm -rf {build,dist,.cache,.mypy_cache,.ruff_cache,.hatch,reports,.tox}
rm -rf htmlcov/
# ===========
# Development
# ===========
.PHONY: install
install:
pip install hatch
.PHONY: install-dev
install-dev:
hatch env create
# ============
# Code quality
# ============
.PHONY: lint
lint:
hatch run lint
.PHONY: lint-check
lint-check:
hatch run ruff check $(package_dir)
hatch run mypy $(package_dir)
.PHONY: format
format:
hatch run format
.PHONY: type-check
type-check:
hatch run type-check
# ======
# Tests
# ======
.PHONY: test
test:
hatch run test
.PHONY: test-cov
test-coverage:
mkdir -p $(reports_dir)/tests/
hatch run pytest --cov=$(package_dir) --cov-report=html:$(reports_dir)/coverage --cov-report=term-missing --html=$(reports_dir)/tests/index.html $(tests_dir)
.PHONY: test-coverage-view
test-coverage-view: test-coverage
python -c "import webbrowser; webbrowser.open('file://$(shell pwd)/$(reports_dir)/coverage/index.html')"
# =====
# Build
# =====
.PHONY: build
build: clean
hatch build
.PHONY: publish
publish: build
hatch publish
.PHONY: publish-test
publish-test: build
hatch publish -r test
# ===
# All
# ===
.PHONY: all
all:
hatch run all