-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
173 lines (143 loc) · 5.6 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
RF ?= 3.1.2
ROBOT ?= rf$(subst .,,$(RF))
PYTHON ?= python39
ARGSTR ?= --argstr python $(PYTHON) --argstr robot $(ROBOT)
CACHIX_CACHE ?= datakurre
.PHONY: all
all: test
.PHONY: clean
clean:
rm -rf .installed.cfg bin
.PHONY: show
show:
pip list
buildout -N annotate versions
.PHONY: test
test: ./bin/test
bin/test
.PHONY: nix-%
nix-%:
nix-shell setup.nix $(ARGSTR) -A package --run "$(MAKE) $*"
nix-env:
nix-build setup.nix $(ARGSTR) -A env
nix-shell:
nix-shell setup.nix $(ARGSTR) -A package
.PHONY: cache
cache:
nix-store --query --references $$(nix-instantiate default.nix $(ARGSTR)) | \
xargs nix-store --realise | xargs nix-store --query --requisites | cachix push $(CACHIX_CACHE)
###
.cache:
mkdir -p .cache
if [ -d ~/.cache/pip ]; then ln -s ~/.cache/pip ./.cache; fi
bin/test: buildout.cfg
buildout -N
.PHONY: requirements
requirements: .cache ./nix/requirements-$(PYTHON)-$(ROBOT).nix
./nix/requirements-$(PYTHON)-$(ROBOT).nix: .cache requirements-$(PYTHON)-$(ROBOT).txt
nix-shell -p "(import ./nix {}).pip2nix.$(PYTHON)" --run "pip2nix generate -r requirements-$(PYTHON)-$(ROBOT).txt --output=./nix/requirements-$(PYTHON)-$(ROBOT).nix"
requirements-$(PYTHON)-$(ROBOT).txt: .cache requirements.txt
nix-shell -p "(import ./nix {}).pip2nix.$(PYTHON)" --run "pip2nix generate -r requirements.txt robotframework==$(RF) --output=./nix/requirements-$(PYTHON)-$(ROBOT).nix"
@grep "pname =\|version =" ./nix/requirements-$(PYTHON)-$(ROBOT).nix|awk "ORS=NR%2?FS:RS"|sed 's|.*"\(.*\)";.*version = "\(.*\)".*|\1==\2|' > requirements-$(PYTHON)-$(ROBOT).txt
.PHONY: nix
nix:
make PYTHON=python27 RF=2.8.2 requirements
make PYTHON=python27 RF=2.8.7 requirements
make PYTHON=python27 RF=2.9.2 requirements
make PYTHON=python27 RF=3.0.4 requirements
make PYTHON=python27 RF=3.1.2 requirements
make PYTHON=python27 RF=3.2.2 requirements
make PYTHON=python27 RF=4.0.3 requirements
make PYTHON=python27 RF=4.1.3 requirements
make PYTHON=python36 RF=3.0.4 requirements
make PYTHON=python36 RF=3.1.2 requirements
make PYTHON=python36 RF=3.2.2 requirements
make PYTHON=python36 RF=4.0.3 requirements
make PYTHON=python36 RF=4.1.3 requirements
make PYTHON=python36 RF=5.0.0 requirements
make PYTHON=python37 RF=3.0.4 requirements
make PYTHON=python37 RF=3.1.2 requirements
make PYTHON=python37 RF=3.2.2 requirements
make PYTHON=python37 RF=4.0.3 requirements
make PYTHON=python37 RF=4.1.3 requirements
make PYTHON=python37 RF=5.0.0 requirements
make PYTHON=python38 RF=3.0.4 requirements
make PYTHON=python38 RF=3.1.2 requirements
make PYTHON=python38 RF=3.2.2 requirements
make PYTHON=python38 RF=4.0.3 requirements
make PYTHON=python38 RF=4.1.3 requirements
make PYTHON=python38 RF=5.0.0 requirements
make PYTHON=python39 RF=3.0.4 requirements
make PYTHON=python39 RF=3.1.2 requirements
make PYTHON=python39 RF=3.2.2 requirements
make PYTHON=python39 RF=4.0.3 requirements
make PYTHON=python39 RF=4.1.3 requirements
make PYTHON=python39 RF=5.0.0 requirements
.PHONY: test-all
test-all:
make PYTHON=python27 RF=2.8.2 clean nix-test
make PYTHON=python27 RF=2.8.7 clean nix-test
make PYTHON=python27 RF=2.9.2 clean nix-test
make PYTHON=python27 RF=3.0.4 clean nix-test
make PYTHON=python27 RF=3.1.2 clean nix-test
make PYTHON=python27 RF=3.2.2 clean nix-test
make PYTHON=python27 RF=4.0.3 clean nix-test
make PYTHON=python27 RF=4.1.3 clean nix-test
make python=python36 rf=3.0.4 clean nix-test
make PYTHON=python36 RF=3.1.2 clean nix-test
make PYTHON=python36 RF=3.2.2 clean nix-test
make PYTHON=python36 RF=4.0.3 clean nix-test
make PYTHON=python36 RF=4.1.3 clean nix-test
make PYTHON=python36 RF=5.0.0 clean nix-test
make PYTHON=python37 RF=3.0.4 clean nix-test
make PYTHON=python37 RF=3.1.2 clean nix-test
make PYTHON=python37 RF=3.2.2 clean nix-test
make PYTHON=python37 RF=4.0.3 clean nix-test
make PYTHON=python37 RF=4.1.3 clean nix-test
make PYTHON=python37 RF=5.0.0 clean nix-test
make PYTHON=python38 RF=3.0.4 clean nix-test
make PYTHON=python38 RF=3.1.2 clean nix-test
make PYTHON=python38 RF=3.2.2 clean nix-test
make PYTHON=python38 RF=4.0.3 clean nix-test
make PYTHON=python38 RF=4.1.3 clean nix-test
make PYTHON=python38 RF=5.0.0 clean nix-test
make PYTHON=python39 RF=3.0.4 clean nix-test
make PYTHON=python39 RF=3.1.2 clean nix-test
make PYTHON=python39 RF=3.2.2 clean nix-test
make PYTHON=python39 RF=4.0.3 clean nix-test
make PYTHON=python39 RF=4.1.3 clean nix-test
make PYTHON=python39 RF=5.0.0 clean nix-test
.PHONY: test-all
cache-all:
make PYTHON=python27 RF=2.8.2 cache
make PYTHON=python27 RF=2.8.7 cache
make PYTHON=python27 RF=2.9.2 cache
make PYTHON=python27 RF=3.0.4 cache
make PYTHON=python27 RF=3.1.2 cache
make PYTHON=python27 RF=3.2.2 cache
make PYTHON=python27 RF=4.0.3 cache
make PYTHON=python27 RF=4.1.3 cache
make python=python36 rf=3.0.4 cache
make PYTHON=python36 RF=3.1.2 cache
make PYTHON=python36 RF=3.2.2 cache
make PYTHON=python36 RF=4.0.3 cache
make PYTHON=python36 RF=4.1.3 cache
make PYTHON=python36 RF=5.0.0 cache
make PYTHON=python37 RF=3.0.4 cache
make PYTHON=python37 RF=3.1.2 cache
make PYTHON=python37 RF=3.2.2 cache
make PYTHON=python37 RF=4.0.3 cache
make PYTHON=python37 RF=4.1.3 cache
make PYTHON=python37 RF=5.0.0 cache
make PYTHON=python38 RF=3.0.4 cache
make PYTHON=python38 RF=3.1.2 cache
make PYTHON=python38 RF=3.2.2 cache
make PYTHON=python38 RF=4.0.3 cache
make PYTHON=python38 RF=4.1.3 cache
make PYTHON=python38 RF=5.0.0 cache
make PYTHON=python39 RF=3.0.4 cache
make PYTHON=python39 RF=3.1.2 cache
make PYTHON=python39 RF=3.2.2 cache
make PYTHON=python39 RF=4.0.3 cache
make PYTHON=python39 RF=4.1.3 cache
make PYTHON=python39 RF=5.0.0 cache