Skip to content

Commit 03c0942

Browse files
ci: run examples serially without parallel
Remove parallel dependency and run examples in a simple bash loop instead. This ensures truly serial execution to avoid any potential memory pressure in CI environments. Changes: - Removed parallel from before-test dependencies - Replaced ./run-examples script call with direct bash loop - Still skip slow examples for CI efficiency - Use MPLBACKEND=Agg to avoid interactive matplotlib 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent a78f520 commit 03c0942

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

cibuildwheel.toml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,40 @@ test-skip = [
3737

3838

3939
linux.before-test = [
40-
"yum install -y parallel >/dev/null",
4140
"pip install 'biopython' 'matplotlib' 'numpy<2' 'pandas' 'pygments' 'scipy'"
4241
]
4342

43+
# Run examples serially (one at a time) without parallel to avoid memory issues in CI
4444
linux.test-command = [
45-
"cd {project} && bash ./run-examples --skip-slow"
45+
"""cd {project}/examples && for f in *.py; do
46+
case "$f" in
47+
benefits_of_sex.py|genealogies_with_selection.py|measuring_fixation_probabilities.py|multi_sample_adaptive.py|mutation_selection_balance_highd.py|neutral_LD_highd.py|speed_highd.py|speed_lowd.py)
48+
echo "Skipping slow example: $f"
49+
;;
50+
*)
51+
echo "Testing $f..."
52+
MPLBACKEND=Agg python3 "$f" || exit 1
53+
;;
54+
esac
55+
done"""
4656
]
4757

4858

4959
macos.before-test = [
50-
"brew install parallel >/dev/null",
5160
"pip install 'biopython' 'matplotlib' 'numpy<2' 'pandas' 'pygments' 'scipy'"
5261
]
5362

54-
# Run same tests as Linux for consistency
63+
# Run same tests as Linux for consistency - serially without parallel
5564
macos.test-command = [
56-
"cd {project} && bash ./run-examples --skip-slow"
65+
"""cd {project}/examples && for f in *.py; do
66+
case "$f" in
67+
benefits_of_sex.py|genealogies_with_selection.py|measuring_fixation_probabilities.py|multi_sample_adaptive.py|mutation_selection_balance_highd.py|neutral_LD_highd.py|speed_highd.py|speed_lowd.py)
68+
echo "Skipping slow example: $f"
69+
;;
70+
*)
71+
echo "Testing $f..."
72+
MPLBACKEND=Agg python3 "$f" || exit 1
73+
;;
74+
esac
75+
done"""
5776
]

0 commit comments

Comments
 (0)