-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
98 lines (61 loc) · 1.43 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
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
92
93
94
95
96
97
98
.SHELL := /bin/bash
name := $(shell pdm show --name)
version := $(shell pdm show --version)
sdist := dist/$(name)-$(version).tar.gz
wheel := dist/$(subst -,_,$(name))-$(version)-py3-none-any.whl
src := $(shell find src -type f -print)
tests := $(shell find tests -type f -print)
python_src := $(filter %.py, $(src) $(tests))
PYTHONDONTWRITEBYTECODE=1
export PYTHONDONTWRITEBYTECODE
.coverage: $(src) $(tests)
pdm run coverage run -m tests
test: .coverage
.PHONY: test
coverage-report: .coverage
pdm run coverage html
pdm run python -m webbrowser -t file://$(CURDIR)/htmlcov/index.html
build: $(sdist) $(wheel)
wheel: $(wheel)
.PHONY: wheel
sdist: $(sdist)
.PHONY: sdist
$(sdist): $(src)
pdm build --no-wheel
$(wheel): $(src)
pdm build --no-sdist
clean: clean-build
rm -rf .coverage .fmt htmlcov .mypy_cache node_modules
.PHONY: clean
clean-build:
rm -rf dist build
.PHONY: clean-build
shell:
pdm run $(.SHELL) -l
.PHONY: shell
pylint:
pdm run pylint src tests
.PHONY: pylint
eslint:
npx eslint src/gentoo_build_publisher/static
.PHONY: eslint
mypy:
pdm run mypy
.PHONY: mypy
csslint:
npx csslint src/gentoo_build_publisher/static
.PHONY: csslint
.PHONY: typos
typos:
typos --format=brief
lint: pylint mypy csslint eslint typos
.PHONY: lint
.fmt: $(python_src)
pdm run python -m isort --line-width=88 $?
pdm run python -m black $?
touch $@
.PHONY: fmt
fmt: .fmt
.PHONY: update
update:
pdm update --update-eager