@@ -14,6 +14,10 @@ parameters:
14
14
type : string
15
15
16
16
common : &common
17
+ parameters :
18
+ python_exec :
19
+ type : string
20
+ default : " python"
17
21
working_directory : ~/repo
18
22
steps :
19
23
- checkout
@@ -31,14 +35,46 @@ common: &common
31
35
- restore_cache :
32
36
keys :
33
37
- cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
38
+ - run :
39
+ name : install pypy3 if python_exec is pypy3
40
+ command : |
41
+ if [ "<< parameters.python_exec >>" == "pypy3" ]; then
42
+ sudo apt-get update
43
+
44
+ # If .pyenv already exists, remove and reinstall to get latest version
45
+ if [ -d "$HOME/.pyenv" ]; then
46
+ echo "Removing existing .pyenv directory..."
47
+ rm -rf $HOME/.pyenv
48
+ fi
49
+ curl https://pyenv.run | bash
50
+ export PATH="$HOME/.pyenv/bin:$PATH"
51
+ eval "$(pyenv init --path)"
52
+ eval "$(pyenv init -)"
53
+ eval "$(pyenv virtualenv-init -)"
54
+
55
+ # Find the latest PyPy version matching the python minor version
56
+ latest_pypy_version=$(pyenv install --list | grep -E "pypy3\.<< parameters.python_minor_version >>" | grep -v "\-src" | tail -1 | tr -d ' ')
57
+ echo "Latest PyPy version: $latest_pypy_version"
58
+
59
+ # Install the latest PyPy 3.10 version using pyenv if not already installed
60
+ pyenv install "$latest_pypy_version"
61
+ pyenv global "$latest_pypy_version"
62
+
63
+ # Verify the correct PyPy version is being used
64
+ pypy3 --version
65
+
66
+ # Install pip using the newly installed PyPy version
67
+ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
68
+ pypy3 get-pip.py
69
+ fi
34
70
- run :
35
71
name : install dependencies
36
72
command : |
37
- python -m pip install --upgrade pip
38
- python -m pip install tox
73
+ << parameters.python_exec >> -m pip install -U pip
74
+ << parameters.python_exec >> -m pip install -U tox
39
75
- run :
40
76
name : run tox
41
- command : python -m tox run -r
77
+ command : << parameters.python_exec >> -m tox -r
42
78
- save_cache :
43
79
paths :
44
80
- .hypothesis
@@ -145,12 +181,30 @@ jobs:
145
181
type : string
146
182
tox_env :
147
183
type : string
184
+ python_exec :
185
+ type : string
186
+ default : " python"
148
187
<< : *common
149
188
docker :
150
189
- image : cimg/python:3.<< parameters.python_minor_version >>
151
190
environment :
152
191
TOXENV : py3<< parameters.python_minor_version >>-<< parameters.tox_env >>
153
192
193
+ common-pypy :
194
+ parameters :
195
+ python_minor_version :
196
+ type : string
197
+ tox_env :
198
+ type : string
199
+ python_exec :
200
+ type : string
201
+ default : " pypy3"
202
+ << : *common
203
+ docker :
204
+ - image : cimg/python:3.<< parameters.python_minor_version >>
205
+ environment :
206
+ TOXENV : pypy3-<< parameters.tox_env >>
207
+
154
208
geth :
155
209
parameters :
156
210
python_minor_version :
@@ -234,6 +288,7 @@ workflows:
234
288
" ensip15" ,
235
289
" wheel"
236
290
]
291
+ python_exec : " python"
237
292
name : " py3<< matrix.python_minor_version >>-<< matrix.tox_env >>"
238
293
- common :
239
294
matrix :
@@ -246,7 +301,21 @@ workflows:
246
301
" ens-eels" ,
247
302
" integration-ethtester-eels"
248
303
]
304
+ python_exec : " python"
249
305
name : " py3<< matrix.python_minor_version >>-<< matrix.tox_env >>"
306
+ - common-pypy :
307
+ matrix :
308
+ parameters :
309
+ # eels only supports 3.10 and above; pyenv only has pypy3.10 available
310
+ python_minor_version : ["10"]
311
+ tox_env : [
312
+ " core-eels" ,
313
+ " core-eels_async" ,
314
+ " ens-eels" ,
315
+ " integration-ethtester-eels"
316
+ ]
317
+ python_exec : " pypy3"
318
+ name : " pypy3<< matrix.python_minor_version >>-<< matrix.tox_env >>"
250
319
- geth :
251
320
matrix :
252
321
parameters :
@@ -272,7 +341,6 @@ workflows:
272
341
python_minor_version : ["10", "11", "12"]
273
342
name : " py3<< matrix.python_minor_version >>-windows-wheel"
274
343
275
-
276
344
nightly :
277
345
triggers :
278
346
- schedule :
0 commit comments