-
Notifications
You must be signed in to change notification settings - Fork 11
/
makefile
57 lines (44 loc) · 1.03 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
SRCS:=ufmt
EXTRAS:=dev,docs,ruff
ifeq ($(OS),Windows_NT)
ACTIVATE:=.venv/Scripts/activate
else
ACTIVATE:=.venv/bin/activate
endif
UV:=$(shell uv --version)
ifdef UV
VENV:=uv venv
PIP:=uv pip
else
VENV:=python -m venv
PIP:=python -m pip
endif
.venv:
$(VENV) .venv
venv: .venv
source $(ACTIVATE) && make install
echo 'run `source $(ACTIVATE)` to use virtualenv'
install:
$(PIP) install -Ue .[$(EXTRAS)]
format:
python -m ufmt format $(SRCS)
lint:
python -m mypy --install-types --non-interactive $(SRCS)
python -m flake8 $(SRCS)
python -m ufmt diff $(SRCS)
test:
python -m coverage run -m $(SRCS).tests
python -m coverage combine
python -m coverage report
deps:
python -m pessimist -c 'python -m $(SRCS).tests' --requirements= --fast .
.PHONY: benchmark
benchmark:
python -m $(SRCS).tests.benchmark
.PHONY: html
html: .venv README.md docs/*.rst docs/conf.py
source $(ACTIVATE) && sphinx-build -ab html docs html
clean:
rm -rf build dist html README MANIFEST *.egg-info .mypy_cache
distclean: clean
rm -rf .venv