Debian Codegraph @

makefile

raw
1 PKG:=aiosqlite
2 EXTRAS:=dev,docs
3
4 UV:=$(shell uv --version)
5 ifdef UV
6 VENV:=uv venv
7 PIP:=uv pip
8 else
9 VENV:=python -m venv
10 PIP:=python -m pip
11 endif
12
13 install:
14 $(PIP) install -Ue .[$(EXTRAS)]
15
16 .venv:
17 $(VENV) .venv
18
19 venv: .venv
20 source .venv/bin/activate && make install
21 echo 'run `source .venv/bin/activate` to activate virtualenv'
22
23 test:
24 python -m coverage run -m $(PKG).tests
25 python -m coverage report
26 python -m mypy -p $(PKG)
27
28 lint:
29 python -m flake8 $(PKG)
30 python -m ufmt check $(PKG)
31
32 format:
33 python -m ufmt format $(PKG)
34
35 perf:
36 python -m unittest -v $(PKG).tests.perf
37
38 .PHONY: html
39 html: .venv README.rst docs/*.rst docs/conf.py
40 .venv/bin/sphinx-build -an -b html docs html
41
42 .PHONY: clean
43 clean:
44 rm -rf build dist html README MANIFEST *.egg-info
45
46 .PHONY: distclean
47 distclean: clean
48 rm -rf .venv