-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmakefile
More file actions
49 lines (38 loc) · 774 Bytes
/
makefile
File metadata and controls
49 lines (38 loc) · 774 Bytes
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
PKG:=attribution
EXTRAS:=dev,docs
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 $(PKG)
lint:
python -m flake8 $(PKG)
python -m ufmt check $(PKG)
test:
python -m coverage run -m $(PKG).tests
python -m coverage report
python -m mypy $(PKG)
.PHONY: html
html:
.venv/bin/sphinx-build -ab html docs html
clean:
rm -rf build dist html README MANIFEST *.egg-info
distclean: clean
rm -rf .venv