-
Notifications
You must be signed in to change notification settings - Fork 5
/
makefile
55 lines (42 loc) · 979 Bytes
/
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
SRCS:=stdlibs
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)]
release: lint test clean
flit publish
regenerate:
python -m stdlibs.fetch_releases
python -m stdlibs.fetch
format:
python -m ufmt format $(SRCS)
lint:
python -m mypy --non-interactive --install-types $(SRCS)
python -m flake8 $(SRCS)
python -m ufmt check $(SRCS)
test:
python -m coverage run -m $(SRCS).tests
python -m coverage report
html: .venv README.md docs/*.rst docs/conf.py
source .venv/bin/activate && sphinx-build -b html docs html
clean:
rm -rf build dist html README MANIFEST *.egg-info .mypy_cache
distclean: clean
rm -rf .venv