-
Notifications
You must be signed in to change notification settings - Fork 62
/
Makefile
60 lines (47 loc) · 1.18 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
58
59
60
MAKEFLAGS += --check-symlink-times
MAKEFLAGS += --jobs
MAKEFLAGS += --no-builtin-rules
MAKEFLAGS += --no-builtin-variables
MAKEFLAGS += --shuffle
MAKEFLAGS += --warn-undefined-variables
SHELL := bash
.DELETE_ON_ERROR:
.ONESHELL:
.SHELLFLAGS := --norc --noprofile -Eeuo pipefail -O dotglob -O nullglob -O extglob -O failglob -O globstar -c
.DEFAULT_GOAL := help
.PHONY: clean clobber build lint fmt
clean:
rm -v -rf -- .mypy_cache/ .venv/
clobber: clean
rm -v -rf -- .vars/
.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 --requirement requirements.txt -- tomli
'$<' <<< '$(PYDEPS)'
lint: .venv/bin/mypy
'$<' -- .
build: .venv/bin/mypy
.venv/bin/python3 -- ci/prepare.py
fmt: .venv/bin/mypy
.venv/bin/isort --profile=black --gitignore -- .
.venv/bin/black -- .