-
Notifications
You must be signed in to change notification settings - Fork 20
/
Makefile
116 lines (95 loc) · 3.9 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
export PYTHON ?= python27
export FEATURE ?= docutils016
TEST = $(wildcard tests/*.py)
SRC = $(wildcard src/sphinxcontrib/httpexample/*.py)
.PHONY: all
all: test coverage
.PHONY: docs
docs:
sphinx-build -b html docs docs/html
ifeq "$(PYTHON)" "python27"
sphinx-build -b pdf docs docs/pdf
endif
.PHONY: coverage
coverage: .coverage
coverage report --fail-under=80
.PHONY: coveralls
coveralls: .coverage
ifeq ($(GITHUB_BASE_REF),)
coveralls
endif
.PHONY: format
format:
black --skip-string-normalization src tests
.PHONY: nix-fmt
nix-fmt:
nix fmt flake.nix setup.nix
.PHONY: show
show:
pip freeze
.PHONY: test
test:
flake8 src
py.test
###
.PHONY: nix-%
nix-%:
nix develop .#$(PYTHON)-$(FEATURE) --accept-flake-config --command $(MAKE) $*
.PHONY: nix-shell
nix-shell:
nix develop .#$(PYTHON)-$(FEATURE) --accept-flake-config
.PHONY: shell
shell:
nix develop .#$(PYTHON)-$(FEATURE) --accept-flake-config
env:
nix build .#$(PYTHON)$-(FEATURE)-env --accept-flake-config -o env
.cache:
mkdir -p .cache
if [ -d ~/.cache/pip ]; then ln -s ~/.cache/pip ./.cache; fi
.coverage: $(TEST) $(SRC)
coverage run setup.py test
nix/requirements-python27-%.nix: .cache nix/requirements-python27-%.txt
nix develop .#pip2nix --command pip2nix generate -r nix/requirements-python27-$*.txt --output=nix/requirements-python27-$*.nix
nix/requirements-python27.txt: .cache requirements.txt
nix develop .#python27-pip2nix --command pip2nix generate -r requirements.txt --output=nix/requirements-python27.nix
@grep "pname =\|version =" nix/requirements-python27.nix|awk "ORS=NR%2?FS:RS"|sed 's|.*"\(.*\)";.*version = "\(.*\)".*|\1==\2|' > nix/requirements-python27.txt
poetry\ add\ --dev\ %:
cp nix/poetry-$(PYTHON)-$(FEATURE).toml pyproject.toml
cp nix/poetry-$(PYTHON)-$(FEATURE).lock poetry.lock
poetry add --group dev $*
mv pyproject.toml nix/poetry-$(PYTHON)-$(FEATURE).toml
mv poetry.lock nix/poetry-$(PYTHON)-$(FEATURE).lock
every\ poetry\ add\ --dev\ %:
PYTHON=python39 FEATURE=docutils016 $(MAKE) poetry\ add\ --dev\ $*
PYTHON=python39 FEATURE=docutils017 $(MAKE) poetry\ add\ --dev\ $*
PYTHON=python39 FEATURE=docutils018 $(MAKE) poetry\ add\ --dev\ $*
PYTHON=python39 FEATURE=docutils019 $(MAKE) poetry\ add\ --dev\ $*
PYTHON=python39 FEATURE=docutils020 $(MAKE) poetry\ add\ --dev\ $*
PYTHON=python310 FEATURE=docutils016 $(MAKE) poetry\ add\ --dev\ $*
PYTHON=python310 FEATURE=docutils017 $(MAKE) poetry\ add\ --dev\ $*
PYTHON=python310 FEATURE=docutils018 $(MAKE) poetry\ add\ --dev\ $*
PYTHON=python310 FEATURE=docutils019 $(MAKE) poetry\ add\ --dev\ $*
PYTHON=python310 FEATURE=docutils020 $(MAKE) poetry\ add\ --dev\ $*
PYTHON=python311 FEATURE=docutils016 $(MAKE) poetry\ add\ --dev\ $*
PYTHON=python311 FEATURE=docutils017 $(MAKE) poetry\ add\ --dev\ $*
PYTHON=python311 FEATURE=docutils018 $(MAKE) poetry\ add\ --dev\ $*
PYTHON=python311 FEATURE=docutils019 $(MAKE) poetry\ add\ --dev\ $*
PYTHON=python311 FEATURE=docutils020 $(MAKE) poetry\ add\ --dev\ $*
test\ all:
PYTHON=python27 FEATURE=docutils016 $(MAKE) nix-test
PYTHON=python27 FEATURE=docutils017 $(MAKE) nix-test
PYTHON=python39 FEATURE=docutils016 $(MAKE) nix-test
PYTHON=python39 FEATURE=docutils017 $(MAKE) nix-test
PYTHON=python39 FEATURE=docutils018 $(MAKE) nix-test
PYTHON=python39 FEATURE=docutils019 $(MAKE) nix-test
PYTHON=python39 FEATURE=docutils020 $(MAKE) nix-test
PYTHON=python310 FEATURE=docutils016 $(MAKE) nix-test
PYTHON=python310 FEATURE=docutils017 $(MAKE) nix-test
PYTHON=python310 FEATURE=docutils018 $(MAKE) nix-test
PYTHON=python310 FEATURE=docutils019 $(MAKE) nix-test
PYTHON=python310 FEATURE=docutils020 $(MAKE) nix-test
PYTHON=python311 FEATURE=docutils016 $(MAKE) nix-test
PYTHON=python311 FEATURE=docutils017 $(MAKE) nix-test
PYTHON=python311 FEATURE=docutils018 $(MAKE) nix-test
PYTHON=python311 FEATURE=docutils019 $(MAKE) nix-test
PYTHON=python311 FEATURE=docutils020 $(MAKE) nix-test