@@ -15,7 +15,8 @@ concurrency:
15
15
cancel-in-progress : true
16
16
17
17
env :
18
- CARGO_ARGS : --no-default-features --features stdlib,zlib,importlib,encodings,sqlite,ssl
18
+ CARGO_ARGS :
19
+ --no-default-features --features stdlib,importlib,encodings,sqlite,ssl
19
20
# Skip additional tests on Windows. They are checked on Linux and MacOS.
20
21
# test_glob: many failing tests
21
22
# test_io: many failing tests
24
25
# test_posixpath: OSError: (22, 'The filename, directory name, or volume label syntax is incorrect. (os error 123)')
25
26
# test_venv: couple of failing tests
26
27
WINDOWS_SKIPS : >-
27
- test_glob
28
- test_io
29
- test_os
30
- test_rlcompleter
31
- test_pathlib
32
- test_posixpath
28
+ test_glob test_io test_os test_rlcompleter test_pathlib test_posixpath
33
29
test_venv
34
30
# configparser: https://github.com/RustPython/RustPython/issues/4995#issuecomment-1582397417
35
31
# socketserver: seems related to configparser crash.
36
32
MACOS_SKIPS : >-
37
- test_configparser
38
- test_socketserver
33
+ test_configparser test_socketserver
39
34
# PLATFORM_INDEPENDENT_TESTS are tests that do not depend on the underlying OS. They are currently
40
35
# only run on Linux to speed up the CI.
41
36
PLATFORM_INDEPENDENT_TESTS : >-
42
- test__colorize
43
- test_array
44
- test_asyncgen
45
- test_binop
46
- test_bisect
47
- test_bool
48
- test_bytes
49
- test_call
50
- test_class
51
- test_cmath
52
- test_collections
53
- test_complex
54
- test_contains
55
- test_copy
56
- test_dataclasses
57
- test_decimal
58
- test_decorators
59
- test_defaultdict
60
- test_deque
61
- test_dict
62
- test_dictcomps
63
- test_dictviews
64
- test_dis
65
- test_enumerate
66
- test_exception_variations
67
- test_float
68
- test_format
69
- test_fractions
70
- test_genericalias
71
- test_genericclass
72
- test_grammar
73
- test_range
74
- test_index
75
- test_int
76
- test_int_literal
77
- test_isinstance
78
- test_iter
79
- test_iterlen
80
- test_itertools
81
- test_json
82
- test_keyword
83
- test_keywordonlyarg
84
- test_list
85
- test_long
86
- test_longexp
87
- test_math
88
- test_operator
89
- test_ordered_dict
90
- test_pow
91
- test_raise
92
- test_richcmp
93
- test_scope
94
- test_set
95
- test_slice
96
- test_sort
97
- test_string
98
- test_string_literals
99
- test_strtod
100
- test_structseq
101
- test_subclassinit
102
- test_super
103
- test_syntax
104
- test_tuple
105
- test_types
106
- test_unary
107
- test_unpack
108
- test_weakref
37
+ test__colorize test_array test_asyncgen test_binop test_bisect test_bool
38
+ test_bytes test_call test_class test_cmath test_collections test_complex
39
+ test_contains test_copy test_dataclasses test_decimal test_decorators
40
+ test_defaultdict test_deque test_dict test_dictcomps test_dictviews test_dis
41
+ test_enumerate test_exception_variations test_float test_format
42
+ test_fractions test_genericalias test_genericclass test_grammar test_range
43
+ test_index test_int test_int_literal test_isinstance test_iter test_iterlen
44
+ test_itertools test_json test_keyword test_keywordonlyarg test_list
45
+ test_long test_longexp test_math test_operator test_ordered_dict test_pow
46
+ test_raise test_richcmp test_scope test_set test_slice test_sort test_string
47
+ test_string_literals test_strtod test_structseq test_subclassinit test_super
48
+ test_syntax test_tuple test_types test_unary test_unpack test_weakref
109
49
test_yield_from
110
50
# Python version targeted by the CI.
111
51
PYTHON_VERSION : " 3.13.1"
116
56
env :
117
57
RUST_BACKTRACE : full
118
58
name : Run rust tests
119
- runs-on : ${{ matrix.os }}
59
+ runs-on : ${{ matrix.os }}
120
60
strategy :
121
61
matrix :
122
62
os : [macos-latest, ubuntu-latest, windows-latest]
@@ -139,22 +79,28 @@ jobs:
139
79
if : runner.os == 'macOS'
140
80
141
81
- name : run clippy
142
- run : cargo clippy ${{ env.CARGO_ARGS }} --workspace --exclude rustpython_wasm -- -Dwarnings
82
+ run :
83
+ cargo clippy ${{ env.CARGO_ARGS }} --workspace --exclude
84
+ rustpython_wasm -- -Dwarnings
143
85
144
86
- name : run rust tests
145
- run : cargo test --workspace --exclude rustpython_wasm --verbose --features threading ${{ env.CARGO_ARGS }}
87
+ run :
88
+ cargo test --workspace --exclude rustpython_wasm --verbose --features
89
+ threading ${{ env.CARGO_ARGS }}
146
90
if : runner.os != 'macOS'
147
91
- name : run rust tests
148
- run : cargo test --workspace --exclude rustpython_wasm --exclude rustpython-jit --verbose --features threading ${{ env.CARGO_ARGS }}
92
+ run :
93
+ cargo test --workspace --exclude rustpython_wasm --exclude
94
+ rustpython-jit --verbose --features threading ${{ env.CARGO_ARGS }}
149
95
if : runner.os == 'macOS'
150
96
151
97
- name : check compilation without threading
152
98
run : cargo check ${{ env.CARGO_ARGS }}
153
99
154
100
- name : Test example projects
155
101
run :
156
- cargo run --manifest-path example_projects/barebone/Cargo.toml
157
- cargo run --manifest-path example_projects/frozen_stdlib/Cargo.toml
102
+ cargo run --manifest-path example_projects/barebone/Cargo.toml cargo
103
+ run --manifest-path example_projects/frozen_stdlib/Cargo.toml
158
104
if : runner.os == 'Linux'
159
105
160
106
- name : prepare AppleSilicon build
@@ -239,7 +185,7 @@ jobs:
239
185
env :
240
186
RUST_BACKTRACE : full
241
187
name : Run snippets and cpython tests
242
- runs-on : ${{ matrix.os }}
188
+ runs-on : ${{ matrix.os }}
243
189
strategy :
244
190
matrix :
245
191
os : [macos-latest, ubuntu-latest, windows-latest]
@@ -261,10 +207,14 @@ jobs:
261
207
run : brew install autoconf automake libtool openssl@3
262
208
if : runner.os == 'macOS'
263
209
- name : build rustpython
264
- run : cargo build --release --verbose --features=threading ${{ env.CARGO_ARGS }}
210
+ run :
211
+ cargo build --release --verbose --features=threading ${{
212
+ env.CARGO_ARGS }}
265
213
if : runner.os == 'macOS'
266
214
- name : build rustpython
267
- run : cargo build --release --verbose --features=threading ${{ env.CARGO_ARGS }},jit
215
+ run :
216
+ cargo build --release --verbose --features=threading ${{
217
+ env.CARGO_ARGS }},jit
268
218
if : runner.os != 'macOS'
269
219
- uses : actions/setup-python@v5
270
220
with :
@@ -275,17 +225,23 @@ jobs:
275
225
- if : runner.os == 'Linux'
276
226
name : run cpython platform-independent tests
277
227
run :
278
- target/release/rustpython -m test -j 1 -u all --slowest --fail-env-changed -v ${{ env.PLATFORM_INDEPENDENT_TESTS }}
228
+ target/release/rustpython -m test -j 1 -u all --slowest
229
+ --fail-env-changed -v ${{ env.PLATFORM_INDEPENDENT_TESTS }}
279
230
- if : runner.os == 'Linux'
280
231
name : run cpython platform-dependent tests (Linux)
281
- run : target/release/rustpython -m test -j 1 -u all --slowest --fail-env-changed -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }}
232
+ run :
233
+ target/release/rustpython -m test -j 1 -u all --slowest
234
+ --fail-env-changed -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }}
282
235
- if : runner.os == 'macOS'
283
236
name : run cpython platform-dependent tests (MacOS)
284
- run : target/release/rustpython -m test -j 1 --slowest --fail-env-changed -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }} ${{ env.MACOS_SKIPS }}
237
+ run :
238
+ target/release/rustpython -m test -j 1 --slowest --fail-env-changed -v
239
+ -x ${{ env.PLATFORM_INDEPENDENT_TESTS }} ${{ env.MACOS_SKIPS }}
285
240
- if : runner.os == 'Windows'
286
241
name : run cpython platform-dependent tests (windows partial - fixme)
287
242
run :
288
- target/release/rustpython -m test -j 1 --slowest --fail-env-changed -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }} ${{ env.WINDOWS_SKIPS }}
243
+ target/release/rustpython -m test -j 1 --slowest --fail-env-changed -v
244
+ -x ${{ env.PLATFORM_INDEPENDENT_TESTS }} ${{ env.WINDOWS_SKIPS }}
289
245
- if : runner.os != 'Windows'
290
246
name : check that --install-pip succeeds
291
247
run : |
@@ -312,7 +268,7 @@ jobs:
312
268
- uses : actions/checkout@v4
313
269
- uses : dtolnay/rust-toolchain@stable
314
270
with :
315
- components : rustfmt, clippy
271
+ components : rustfmt, clippy
316
272
- name : run rustfmt
317
273
run : cargo fmt --check
318
274
- name : run clippy on wasm
@@ -323,9 +279,13 @@ jobs:
323
279
- name : install ruff
324
280
run : python -m pip install ruff==0.0.291 # astral-sh/ruff#7778
325
281
- name : run python lint
326
- run : ruff extra_tests wasm examples --exclude='./.*',./Lib,./vm/Lib,./benches/ --select=E9,F63,F7,F82 --show-source
282
+ run :
283
+ ruff extra_tests wasm
284
+ examples --exclude='./.*',./Lib,./vm/Lib,./benches/
285
+ --select=E9,F63,F7,F82 --show-source
327
286
- name : install prettier
328
- run : yarn global add prettier && echo "$(yarn global bin)" >>$GITHUB_PATH
287
+ run :
288
+ yarn global add prettier && echo "$(yarn global bin)" >>$GITHUB_PATH
329
289
- name : check wasm code with prettier
330
290
# prettier doesn't handle ignore files very well: https://github.com/prettier/prettier/issues/8506
331
291
run : cd wasm && git ls-files -z | xargs -0 prettier --check -u
@@ -338,14 +298,16 @@ jobs:
338
298
- uses : actions/checkout@v4
339
299
- uses : dtolnay/rust-toolchain@master
340
300
with :
341
- toolchain : nightly
342
- components : miri
301
+ toolchain : nightly
302
+ components : miri
343
303
344
304
- uses : Swatinem/rust-cache@v2
345
305
- name : Run tests under miri
346
306
# miri-ignore-leaks because the type-object circular reference means that there will always be
347
307
# a memory leak, at least until we have proper cyclic gc
348
- run : MIRIFLAGS='-Zmiri-ignore-leaks' cargo +nightly miri test -p rustpython-vm -- miri_test
308
+ run :
309
+ MIRIFLAGS='-Zmiri-ignore-leaks' cargo +nightly miri test -p
310
+ rustpython-vm -- miri_test
349
311
350
312
wasm :
351
313
if : ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
@@ -357,7 +319,8 @@ jobs:
357
319
358
320
- uses : Swatinem/rust-cache@v2
359
321
- name : install wasm-pack
360
- run : curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
322
+ run :
323
+ curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
361
324
- name : install geckodriver
362
325
run : |
363
326
wget https://github.com/mozilla/geckodriver/releases/download/v0.34.0/geckodriver-v0.34.0-linux64.tar.gz
@@ -420,8 +383,14 @@ jobs:
420
383
- name : Install clang
421
384
run : sudo apt-get update && sudo apt-get install clang -y
422
385
- name : build rustpython
423
- run : cargo build --release --target wasm32-wasip1 --features freeze-stdlib,stdlib --verbose
386
+ run :
387
+ cargo build --release --target wasm32-wasip1 --features
388
+ freeze-stdlib,stdlib --verbose
424
389
- name : run snippets
425
- run : wasmer run --dir `pwd` target/wasm32-wasip1/release/rustpython.wasm -- `pwd`/extra_tests/snippets/stdlib_random.py
390
+ run :
391
+ wasmer run --dir `pwd` target/wasm32-wasip1/release/rustpython.wasm --
392
+ ` pwd` /extra_tests/snippets/stdlib_random.py
426
393
- name : run cpython unittest
427
- run : wasmer run --dir `pwd` target/wasm32-wasip1/release/rustpython.wasm -- `pwd`/Lib/test/test_int.py
394
+ run :
395
+ wasmer run --dir `pwd` target/wasm32-wasip1/release/rustpython.wasm --
396
+ ` pwd` /Lib/test/test_int.py
0 commit comments