Skip to content

Commit 19ea2ab

Browse files
committed
CI: Build wxPython .wgn for Python 3.12 and Python 3.13
...and use it to run all Python version jobs on Linux by default, rather than Windows or macOS, since Linux CI runners are cheaper
1 parent 17dceae commit 19ea2ab

File tree

2 files changed

+74
-12
lines changed

2 files changed

+74
-12
lines changed

.github/workflows/ci.yaml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,14 @@ jobs:
365365
# NOTE: When adding new Linux versions, you may need
366366
# to compile new wxPython .wgn files
367367
- ubuntu-22.04
368-
# Test the earliest supported Python version only
368+
# Test earliest to latest Python versions supported by Crystal,
369+
# on at least one OS.
369370
python-version:
371+
# NOTE: When adding new Python versions, you may need
372+
# to compile new wxPython .wgn files
370373
- "3.11.9"
374+
- "3.12.9"
375+
- "3.13.5"
371376
fail-fast: false
372377
runs-on: ${{ matrix.os }}
373378
timeout-minutes: 9 # 150% of normal time: 5 min, as of 2025-07-21
@@ -405,6 +410,11 @@ jobs:
405410
- name: Install wxPython dependencies
406411
run: sudo apt-get install -y libgtk-3-dev
407412

413+
# Install additional dependencies for Python 3.13 wxPython
414+
- name: Install wxPython dependencies for Python 3.13
415+
if: startsWith(matrix.python-version, '3.13.')
416+
run: sudo apt-get install -y libnotify4
417+
408418
# Install wxPython from precompiled wagon because installing
409419
# wxPython from source takes about 40 minutes on GitHub Actions
410420
#
@@ -416,8 +426,22 @@ jobs:
416426
wget --no-verbose https://github.com/davidfstr/Crystal-Web-Archiver/releases/download/v1.4.0b/wxPython-4.2.3-py311-none-linux_x86_64.wgn
417427
poetry run wagon install wxPython-4.2.3-py311-none-linux_x86_64.wgn
418428
429+
- name: Install dependency wxPython from wagon (Python 3.12)
430+
if: startsWith(matrix.python-version, '3.12.')
431+
run: |
432+
poetry run pip3 install wagon
433+
wget --no-verbose https://github.com/davidfstr/Crystal-Web-Archiver/releases/download/v1.4.0b/wxPython-4.2.3-py312-none-linux_x86_64.wgn
434+
poetry run wagon install wxPython-4.2.3-py312-none-linux_x86_64.wgn
435+
436+
- name: Install dependency wxPython from wagon (Python 3.13)
437+
if: startsWith(matrix.python-version, '3.13.')
438+
run: |
439+
poetry run pip3 install wagon
440+
wget --no-verbose https://github.com/davidfstr/Crystal-Web-Archiver/releases/download/v1.4.0b/wxPython-4.2.3-py313-none-linux_x86_64.wgn
441+
poetry run wagon install wxPython-4.2.3-py313-none-linux_x86_64.wgn
442+
419443
- name: Fail if wxPython wagon is not available for this Python version
420-
if: ${{ !startsWith(matrix.python-version, '3.11.') }}
444+
if: ${{ !startsWith(matrix.python-version, '3.11.') && !startsWith(matrix.python-version, '3.12.') && !startsWith(matrix.python-version, '3.13.') }}
421445
run: |
422446
echo "ERROR: No precompiled wxPython wagon is available for Python ${{ matrix.python-version }} on Linux."
423447
echo "You must build a .wgn for this Python version and update the workflow."
@@ -466,16 +490,7 @@ jobs:
466490
# NOTE: Earliest Windows supported by Crystal is Windows 11 (from the README)
467491
- windows-2025 # based on Windows 11 version 24H2 (Germanium)
468492
python-version:
469-
# Test earliest to latest Python versions supported by Crystal,
470-
# on at least one OS.
471-
#
472-
# NOTE: Testing all Python versions on Linux would be faster
473-
# than on Windows because Linux runners are faster than
474-
# every other OS. However Windows is the second fastest OS,
475-
# and doesn't require precompiled wxPython .wgn files.
476493
- "3.11.9"
477-
- "3.12.9"
478-
- "3.13.5"
479494
fail-fast: false
480495
runs-on: ${{ matrix.os }}
481496
timeout-minutes: 43 # 150% of normal time: 29 min, as of 2025-07-21

doc/how_to_make_wxpython_wagon.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,45 @@ wget https://bootstrap.pypa.io/get-pip.py
6060
python3.11 get-pip.py
6161
```
6262

63+
* Install Python 3.12, if appropriate for this .wgn
64+
65+
```bash
66+
# Install Python 3.12 (from source)
67+
apt-get update
68+
apt-get install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev wget
69+
curl -O https://www.python.org/ftp/python/3.12.9/Python-3.12.9.tar.xz
70+
tar -xf Python-3.12.9.tar.xz
71+
cd Python-3.12.9
72+
time ./configure
73+
# real 0m28.451s
74+
time make -j4
75+
# real 1m11.544s
76+
make install
77+
python3.12 --version
78+
# Install pip for Python 3.12
79+
wget https://bootstrap.pypa.io/get-pip.py
80+
python3.12 get-pip.py
81+
```
82+
83+
* Install Python 3.13, if appropriate for this .wgn
84+
85+
```bash
86+
# Install Python 3.13.5 (from source)
87+
apt-get update
88+
apt-get install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev wget
89+
curl -O https://www.python.org/ftp/python/3.13.5/Python-3.13.5.tar.xz
90+
tar -xf Python-3.13.5.tar.xz
91+
cd Python-3.13.5
92+
time ./configure
93+
# real 9m55.020s
94+
time make -j4
95+
# real 13m31.239s
96+
./python --version
97+
# Install pip for Python 3.13
98+
wget https://bootstrap.pypa.io/get-pip.py
99+
./python get-pip.py
100+
```
101+
63102
* Install wxPython dependencies and wagon
64103

65104
```bash
@@ -79,7 +118,15 @@ python3 -m pip install wagon[dist] # or: python3.x -m pip install wagon[dist]
79118
# Compile wagon
80119
cd /usr/src # shared folder with Docker host
81120
time wagon create wxPython==4.2.3 # use version from pyproject.toml
82-
# real 81m6.382s
121+
# real 81m6.382s (Python 3.9)
122+
# real ~80m+ (Python 3.12.9)
123+
# real ~80m+ (Python 3.13.5)
124+
```
125+
126+
If using a locally built Python from source:
127+
128+
```bash
129+
time ./python -m wagon create wxPython==4.2.3 # use version from pyproject.toml
83130
```
84131

85132
* Upload the .wgn file as a release artifact to a release tag on GitHub,

0 commit comments

Comments
 (0)