Skip to content
This repository was archived by the owner on Aug 31, 2025. It is now read-only.

Commit 9a0f269

Browse files
committed
Upgrade PyQt5, test more Python versions, and macOS arm64.
1 parent 2f07fcc commit 9a0f269

File tree

5 files changed

+51
-72
lines changed

5 files changed

+51
-72
lines changed

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
analyze:
1616
timeout-minutes: 20
1717
name: Analyze
18-
runs-on: ubuntu-20.04
18+
runs-on: ubuntu-22.04
1919
permissions:
2020
actions: read
2121
contents: read

.github/workflows/test.yml

Lines changed: 14 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ jobs:
1111
timeout-minutes: 30
1212
strategy:
1313
matrix:
14-
# macos-13 is x86 and macos-14 is arm64
15-
os: [ubuntu-20.04, ubuntu-latest, macos-13, windows-2019, windows-latest]
16-
python-version: ['3.5', '3.6', '3.7', '3.8']
14+
# macos-13 is the last release on x86, and macos-14 is arm64
15+
os: [ubuntu-20.04, ubuntu-24.04, macos-13, macos-14, windows-2019, windows-latest]
16+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
1717
exclude:
18-
# Python 3.5 and 3.6 not available in the latest Ubuntu runners
19-
- os: ubuntu-latest
20-
python-version: '3.5'
21-
- os: ubuntu-latest
22-
python-version: '3.6'
18+
# These Python versions are not available in macOS arm64 or Ubuntu 24.04
19+
- os: macos-14
20+
python-version: '3.7'
21+
- os: ubuntu-24.04
22+
python-version: '3.7'
2323
fail-fast: false
2424
runs-on: ${{ matrix.os }}
2525
name: Test Py ${{ matrix.python-version }} - ${{ matrix.os }}
@@ -29,10 +29,6 @@ jobs:
2929
uses: actions/setup-python@v5
3030
with:
3131
python-version: ${{ matrix.python-version }}
32-
env:
33-
# Workaround to issue using Python 3.5
34-
# https://github.com/actions/setup-python/issues/866
35-
PIP_TRUSTED_HOST: "pypi.python.org pypi.org files.pythonhosted.org"
3632
- name: Display Python info
3733
run: |
3834
python -c "import sys; print(sys.version)"
@@ -42,19 +38,14 @@ jobs:
4238
pip --version
4339
pip config list
4440
pip freeze
45-
- name: Prepare Ubuntu
46-
if: runner.os == 'Linux'
47-
run: |
48-
sudo apt-get update
49-
sudo apt-get install -y libxkbcommon-x11-0 xvfb
5041
- name: Install Mu dependencies
5142
run: |
5243
pip install .[dev]
5344
pip list
5445
timeout-minutes: 10
5546
- name: Run tests
5647
if: runner.os == 'Linux'
57-
run: xvfb-run make check
48+
run: QT_QPA_PLATFORM=offscreen python make.py check
5849
timeout-minutes: 5
5950
- name: Run tests
6051
if: runner.os != 'Linux'
@@ -105,7 +96,7 @@ jobs:
10596
runs-on: ubuntu-latest
10697
strategy:
10798
matrix:
108-
docker-tag: ['stretch-2018-03-13', 'buster-2021-05-28', 'buster-legacy-2023-05-03']
99+
docker-tag: ['buster-2021-05-28', 'buster-legacy-2023-05-03', 'bullseye-2023-05-03']
109100
fail-fast: false
110101
services:
111102
rpios:
@@ -131,16 +122,6 @@ jobs:
131122
git checkout --progress FETCH_HEAD
132123
echo "cd ~/mu" > ~/.bashrc_new && cat ~/.bashrc >> ~/.bashrc_new
133124
rm ~/.bashrc && mv ~/.bashrc_new ~/.bashrc
134-
# As Pi OS stretch is no longer supported the repository URL was moved and is no longer updated
135-
- name: Update Stretch sources.list
136-
if: ${{ matrix.docker-tag == 'stretch-2018-03-13' }}
137-
uses: appleboy/[email protected]
138-
with:
139-
host: rpios
140-
username: pi
141-
password: raspberry
142-
port: ${{ job.services.rpios.ports[5022] }}
143-
script: echo "deb http://legacy.raspbian.org/raspbian/ stretch main contrib non-free rpi" | sudo tee /etc/apt/sources.list
144125
- name: Install Mu extra apt dependencies
145126
uses: appleboy/[email protected]
146127
with:
@@ -159,13 +140,15 @@ jobs:
159140
password: raspberry
160141
port: ${{ job.services.rpios.ports[5022] }}
161142
command_timeout: 25m
143+
# Some compiled packages take a while to be built in piwheels, so to
144+
# avoid intermittent pip install failures we use `--prefer-binary`
162145
script: |
163146
python3 -m virtualenv ~/mu/.venv -v --python=python3 --system-site-packages
164147
echo "source ~/mu/.venv/bin/activate" > ~/.bashrc_new && cat ~/.bashrc >> ~/.bashrc_new
165148
rm ~/.bashrc && mv ~/.bashrc_new ~/.bashrc
166149
source .venv/bin/activate
167150
python -m pip list
168-
python -m pip install ".[dev]"
151+
python -m pip install ."[dev]" --prefer-binary
169152
- name: Environment info
170153
uses: appleboy/[email protected]
171154
with:
@@ -186,6 +169,5 @@ jobs:
186169
username: pi
187170
password: raspberry
188171
port: ${{ job.services.rpios.ports[5022] }}
189-
# The time out can be decreased to 30 min when Stretch is dropped
190-
command_timeout: 45m
172+
command_timeout: 30m
191173
script: xvfb-run python make.py check

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ macos: check
112112
# 1. Not really needed.
113113
# 2. Previously active venv would be "gone" on venv-pup deactivation.
114114
# Installing pup from a fork with the --pip-platform flag proof of concept
115-
# and using it to install wheels for the `macosx_10_12_x86_64` platform
115+
# and using it to install wheels for the `macosx_10_13_x86_64` platform
116116
./venv-pup/bin/pip install git+https://github.com/carlosperate/pup.git@pip-platform
117-
./venv-pup/bin/pup package --launch-module=mu --nice-name="Mu Editor" --icon-path=./package/icons/mac_icon.icns --license-path=./LICENSE --pip-platform=macosx_10_12_x86_64 .
117+
./venv-pup/bin/pup package --launch-module=mu --nice-name="Mu Editor" --icon-path=./package/icons/mac_icon.icns --license-path=./LICENSE --pip-platform=macosx_10_13_x86_64 .
118118
rm -r venv-pup
119119
ls -la ./build/pup/
120120
ls -la ./dist/

mu/wheels/__init__.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,9 @@ class WheelsBuildError(WheelsError):
4242
("flask", ("flask==2.0.3", "Werkzeug<3.0.0")),
4343
# The version of ipykernel here should match to the version used by
4444
# qtconsole at the version specified in setup.py
45-
# FIXME: ipykernel max ver added for macOS 10.13 compatibility, min taken
46-
# from qtconsole 4.7.7. This is mirrored in setup.py
47-
("ipykernel", ("ipykernel>=4.1,<6",)),
48-
# FIXME: ipykernel<6 depends on ipython_genutils, but it isn't explicitly
49-
# declared as a dependency. It also depends on traitlets, which
50-
# incidentally brought ipython_genutils, but in v5.1 it was dropped, so as
51-
# a workaround we need to manually specify it here
52-
("ipython_genutils", ("ipython_genutils>=0.2.0",)),
45+
# ipykernel max ver added for macOS 10.13 compatibility, min taken
46+
# from setup.py. This is version has to mirror the one from setup.py
47+
("ipykernel", ("ipykernel>=5.5.6,<6",)),
5348
]
5449

5550

@@ -62,12 +57,12 @@ def os_compatibility_flags():
6257
an issue to be resolved before doing a Mu release.
6358
"""
6459
extra_flags = []
65-
# For macOS the oldest supported version is 10.12 Sierra, as that's the
66-
# oldest version supported by PyQt5 v5.13
60+
# For macOS the oldest supported version is 10.13 High Sierra,
61+
# as that's the oldest version supported by PyQt5 v5.15
6762
if sys.platform == "darwin":
6863
extra_flags.extend(
6964
[
70-
"--platform=macosx_10_12_x86_64",
65+
"--platform=macosx_10_13_x86_64",
7166
"--only-binary=:all:",
7267
]
7368
)

setup.py

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,27 @@
2525
# The core 'install_requires' should only be things
2626
# which are needed for the main editor to function.
2727
#
28-
"PyQt5-sip<=12.13.0"
29-
+ ';"arm" not in platform_machine and "aarch" not in platform_machine',
30-
"PyQt5==5.13.2"
31-
+ ';"arm" not in platform_machine and "aarch" not in platform_machine',
32-
"QScintilla==2.11.3"
33-
+ ';"arm" not in platform_machine and "aarch" not in platform_machine',
34-
"PyQtChart==5.13.1"
35-
+ ';"arm" not in platform_machine and "aarch" not in platform_machine',
28+
"PyQt5==5.15.10"
29+
+ '; sys_platform != "linux" '
30+
+ 'or ("arm" not in platform_machine and "aarch" not in platform_machine)',
31+
"QScintilla==2.14.1"
32+
+ '; sys_platform != "linux" '
33+
+ 'or ("arm" not in platform_machine and "aarch" not in platform_machine)',
34+
"PyQtChart==5.15.6"
35+
+ '; sys_platform != "linux" '
36+
+ 'or ("arm" not in platform_machine and "aarch" not in platform_machine)',
3637
# FIXME: Needed for qtconsole, this is the latest wheel in armv7l for
3738
# Python 3.7 (Buster), otherwise it tries to build from source and fails.
3839
"pyzmq<=26.0.3",
39-
# FIXME: jupyter-client added for Py3.5 compatibility, to be dropped after
40-
# Mu v1.1 release. So, qtconsole < 5 and jupyter-client < 6.2 (issue #1444)
41-
"jupyter-client>=4.1,<6.2",
42-
# FIXME: ipykernel max added for macOS 10.13 compatibility, min taken from
43-
# qtconsole 4.7.7. Full line can be removed after Mu v1.1 release.
44-
# Dependency mirrored for user venv in mu/wheels/__init__.py
45-
"ipykernel>=4.1,<6",
46-
# FIXME: ipykernel<6 depends on ipython_genutils, but it isn't explicitly
47-
# declared as a dependency. It also depends on traitlets, which
48-
# incidentally brought ipython_genutils, but in v5.1 it was dropped, so as
49-
# a workaround we need to manually specify it here.
50-
"ipython_genutils>=0.2.0",
51-
"qtconsole==4.7.7",
52-
#
40+
# ipykernel has to be < v6 for macOS 10.13 compatibility (v6 depends on
41+
# debugpy package), v5.5.6 resolves issue ipython/ipykernel#759.
42+
# Full line can be removed after Mu v1.3 release as PyQt6 drops old macOS.
43+
# ipykernel version has to be mirrored in mu/wheels/__init__.py
44+
"ipykernel>=5.5.6,<6",
45+
"qtconsole~=5.4",
46+
# In Python 3.12 the deprecated 'imp' module was removed from the stdlib.
47+
# ipykernel only moved to importlib in v6.10, so this is a "forward-port"
48+
"zombie_imp>=0.0.2;python_version>='3.12'",
5349
# adafruit-board-toolkit is used to find serial ports and help identify
5450
# CircuitPython boards in the CircuitPython mode.
5551
"adafruit-board-toolkit~=1.1",
@@ -63,7 +59,7 @@
6359
"flake8 >= 3.8.3",
6460
# Clamp click max version to workaround incompatibility with black<22.1.0
6561
"click<=8.0.4",
66-
"black>=19.10b0,<22.1.0;python_version>'3.5'",
62+
"black>=19.10b0,<22.1.0",
6763
"platformdirs>=2.0.0,<3.0.0",
6864
"semver>=2.8.0",
6965
# virtualenv vendors pip, we need at least pip v19.3 to install some
@@ -80,6 +76,9 @@
8076
# Needed to resolve an issue with paths in the user virtual environment
8177
#
8278
"pywin32; sys_platform=='win32'",
79+
# pkg_resources has been removed in Python 3.12, until we move to importlib
80+
# we need it via setuptools: https://github.com/mu-editor/mu/issues/2485
81+
"setuptools",
8382
]
8483

8584

@@ -133,7 +132,7 @@
133132
"mu.modes.api",
134133
"mu.wheels",
135134
],
136-
python_requires=">=3.5,<3.9",
135+
python_requires=">=3.7,<3.14",
137136
install_requires=install_requires,
138137
extras_require=extras_require,
139138
package_data={"mu.wheels": ["*.whl", "*.zip"]},
@@ -152,10 +151,13 @@
152151
"Operating System :: MacOS :: MacOS X",
153152
"Operating System :: Microsoft :: Windows",
154153
"Programming Language :: Python :: 3 :: Only",
155-
"Programming Language :: Python :: 3.5",
156-
"Programming Language :: Python :: 3.6",
157154
"Programming Language :: Python :: 3.7",
158155
"Programming Language :: Python :: 3.8",
156+
"Programming Language :: Python :: 3.9",
157+
"Programming Language :: Python :: 3.10",
158+
"Programming Language :: Python :: 3.11",
159+
"Programming Language :: Python :: 3.12",
160+
"Programming Language :: Python :: 3.13",
159161
"Topic :: Education",
160162
"Topic :: Games/Entertainment",
161163
"Topic :: Software Development",

0 commit comments

Comments
 (0)