Skip to content

Commit 7137e94

Browse files
committed
wxPython Wagons: Update build instructions
1 parent baa980f commit 7137e94

File tree

2 files changed

+85
-3
lines changed

2 files changed

+85
-3
lines changed

doc/how_to_make_wxpython_wagon.md

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ sed -i 's/from urllib import urlopen/from urllib.request import urlopen/' $WAGON
146146
```bash
147147
# Compile wagon
148148
cd /usr/src # shared folder with Docker host
149-
time wagon create wxPython==4.2.4 # use version from pyproject.toml
149+
time wagon create wxPython==4.2.5 # use version from pyproject.toml
150150
# real 81m6.382s (Python 3.9)
151151
# real ~80m+ (Python 3.12.9)
152152
# real ~80m+ (Python 3.13.5)
@@ -156,11 +156,11 @@ time wagon create wxPython==4.2.4 # use version from pyproject.toml
156156
If using a locally built Python from source:
157157

158158
```bash
159-
time ./python -m wagon create wxPython==4.2.4 # use version from pyproject.toml
159+
time ./python -m wagon create wxPython==4.2.5 # use version from pyproject.toml
160160
```
161161

162162
* Upload the .wgn file as a release artifact to a release tag on GitHub,
163-
such as the [v1.4.0b tag](https://github.com/davidfstr/Crystal-Web-Archiver/releases/tag/v1.4.0b)
163+
such as the [v1.5.0b tag](https://github.com/davidfstr/Crystal-Web-Archiver/releases/tag/v1.5.0b)
164164

165165
* Copy the URL for that .wgn to ci.yaml, replacing the old .wgn
166166

@@ -170,3 +170,31 @@ time ./python -m wagon create wxPython==4.2.4 # use version from pyproject.toml
170170
* Ensure the job completes successfully. In particular ensure that the
171171
"Install dependency wxPython from wagon" step does successfully install
172172
and the "Install remaining dependencies with Poetry" step does not timeout.
173+
174+
### Troubleshooting: Building wxPython < 4.2.5
175+
176+
wxPython versions before 4.2.5 have a build incompatibility with setuptools >= 81.
177+
The symptom is a `TypeError` during the wheel packaging step (after compilation
178+
succeeds):
179+
180+
```
181+
File "<string>", line 249, in wx_copy_file
182+
TypeError: copy_file() takes from 2 to 7 positional arguments but 8 were given
183+
```
184+
185+
This was fixed in wxPython 4.2.5 (commit 1dec4c8, Feb 6, 2026) which updated
186+
the monkey-patched `copy_file` and `copy_tree` functions in `setup.py` to match
187+
the new distutils API.
188+
189+
Note that pip creates an **isolated build environment** (per PEP 517) and
190+
downloads the latest setuptools from PyPI into it, regardless of what setuptools
191+
version is installed globally. So simply running `pip install "setuptools<81"`
192+
before building will **not** help.
193+
194+
If you must build wxPython < 4.2.5, an **untested** workaround is to disable
195+
pip's build isolation so it uses a globally pinned older setuptools:
196+
197+
```bash
198+
pip install "setuptools<81" wheel
199+
pip wheel wxPython==4.2.4 --no-build-isolation --no-cache-dir
200+
```
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo "========================================="
5+
echo "Building wxPython wagon for aarch64"
6+
echo "========================================="
7+
8+
echo "Architecture check:"
9+
uname -m
10+
11+
echo ""
12+
echo "Installing build dependencies..."
13+
apt-get update
14+
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 libgtk-3-dev
15+
16+
echo ""
17+
echo "Building Python 3.14 from source..."
18+
cd /tmp
19+
curl -O https://www.python.org/ftp/python/3.14.0/Python-3.14.0.tar.xz
20+
tar -xf Python-3.14.0.tar.xz
21+
cd Python-3.14.0
22+
echo "Configure..."
23+
./configure
24+
echo "Compile (this will take a few minutes)..."
25+
make -j4
26+
make install
27+
28+
echo ""
29+
echo "Python version:"
30+
python3.14 --version
31+
32+
echo ""
33+
echo "Installing pip..."
34+
curl -O https://bootstrap.pypa.io/get-pip.py
35+
python3.14 get-pip.py
36+
37+
echo ""
38+
echo "Installing wagon..."
39+
python3.14 -m pip install wagon[dist]
40+
41+
echo ""
42+
echo "Patching wagon for Python 3.14+..."
43+
WAGON_PATH=/usr/local/lib/python3.14/site-packages/wagon.py
44+
sed -i 's/from urllib.request import URLopener/from urllib.request import urlopen/' $WAGON_PATH
45+
sed -i 's/from urllib import urlopen/from urllib.request import urlopen/' $WAGON_PATH
46+
47+
echo ""
48+
echo "Building wxPython wagon (this will take 30-60 minutes)..."
49+
cd /usr/src
50+
python3.14 -m wagon create wxPython==4.2.5
51+
52+
echo ""
53+
echo "Build complete!"
54+
ls -lh /usr/src/*.wgn

0 commit comments

Comments
 (0)