Skip to content

Commit 2c838ca

Browse files
committed
Set MPLBACKEND=Agg in CI to fix Tkinter issues on Windows
On Windows Python 3.13 CI environment, Tcl/Tk is not properly configured, causing matplotlib tests to fail with TclError. Setting the MPLBACKEND environment variable to 'Agg' (non-interactive backend) resolves this issue. Changes: - Added MPLBACKEND=Agg env var to all test jobs (Linux, macOS, Windows) - This ensures consistent behavior across all CI platforms - Fixes TclError in test_phase_plane.py and test_aligns.py on Windows This is a cleaner solution than modifying individual test files.
1 parent 6b410aa commit 2c838ca

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

.github/workflows/CI.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ jobs:
4848
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
4949
pip install -e .
5050
- name: Test with pytest
51+
env:
52+
MPLBACKEND: Agg # Use non-interactive backend for matplotlib
5153
run: |
5254
pytest brainpy/
5355
@@ -77,6 +79,8 @@ jobs:
7779
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
7880
pip install -e .
7981
- name: Test with pytest
82+
env:
83+
MPLBACKEND: Agg # Use non-interactive backend for matplotlib
8084
run: |
8185
pytest brainpy/
8286
@@ -106,5 +110,7 @@ jobs:
106110
python -m pip install -r requirements-dev.txt
107111
pip install -e .
108112
- name: Test with pytest
113+
env:
114+
MPLBACKEND: Agg # Use non-interactive backend for matplotlib
109115
run: |
110116
pytest brainpy/

0 commit comments

Comments
 (0)