-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
56 lines (42 loc) · 1014 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
MAKEFLAGS += --jobs
MAKEFLAGS += --no-builtin-rules
MAKEFLAGS += --warn-undefined-variables
SHELL := bash
.DELETE_ON_ERROR:
.ONESHELL:
.SHELLFLAGS := -Eeuo pipefail -O dotglob -O nullglob -O extglob -O failglob -O globstar -c
.DEFAULT_GOAL := help
.PHONY: clean clobber lint test build fmt test
clean:
rm -v -rf -- .mypy_cache/
clobber: clean
rm -v -rf -- .venv/
.venv/bin/python3:
python3 -m venv -- .venv
define PYDEPS
from itertools import chain
from os import execl
from sys import executable
from tomli import load
toml = load(open("pyproject.toml", "rb"))
project = toml["project"]
execl(
executable,
executable,
"-m",
"pip",
"install",
"--upgrade",
"--",
*project.get("dependencies", ()),
*chain.from_iterable(project["optional-dependencies"].values()),
)
endef
.venv/bin/mypy: .venv/bin/python3
'$<' -m pip install -- tomli
'$<' <<< '$(PYDEPS)'
lint: .venv/bin/mypy
'$<' -- .
fmt: .venv/bin/mypy
.venv/bin/isort --profile=black --gitignore -- .
.venv/bin/black -- .