Skip to content

Commit 55a1615

Browse files
committed
Upgrade PyQt5 and supported Python versions.
1 parent 30af5d5 commit 55a1615

File tree

7 files changed

+44
-68
lines changed

7 files changed

+44
-68
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
pip list
7575
- run: mkdir upload
7676
- name: Build Linux AppImage
77-
run: xvfb-run make linux
77+
run: QT_QPA_PLATFORM=offscreen make linux
7878
# GitHub actions upload artifact breaks permissions, workaround using tar
7979
# https://github.com/actions/upload-artifact/issues/38
8080
- name: Tar AppImage to maintain permissions

.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: 12 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,7 @@ jobs:
1212
strategy:
1313
matrix:
1414
os: [ubuntu-20.04, ubuntu-latest, macos-11, macos-latest, windows-2019, windows-latest]
15-
python-version: ['3.5', '3.6', '3.7', '3.8']
16-
exclude:
17-
# Python 3.5 and 3.6 not available in the latest Ubuntu runners
18-
- os: ubuntu-latest
19-
python-version: '3.5'
20-
- os: ubuntu-latest
21-
python-version: '3.6'
15+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
2216
fail-fast: false
2317
runs-on: ${{ matrix.os }}
2418
name: Test Py ${{ matrix.python-version }} - ${{ matrix.os }}
@@ -37,19 +31,14 @@ jobs:
3731
pip --version
3832
pip config list
3933
pip freeze
40-
- name: Prepare Ubuntu
41-
if: runner.os == 'Linux'
42-
run: |
43-
sudo apt-get update
44-
sudo apt-get install -y libxkbcommon-x11-0 xvfb
4534
- name: Install Mu dependencies
4635
run: |
4736
pip install .[dev]
4837
pip list
4938
timeout-minutes: 10
5039
- name: Run tests
5140
if: runner.os == 'Linux'
52-
run: xvfb-run make check
41+
run: QT_QPA_PLATFORM=offscreen python make.py check
5342
timeout-minutes: 5
5443
- name: Run tests
5544
if: runner.os != 'Linux'
@@ -100,7 +89,7 @@ jobs:
10089
runs-on: ubuntu-latest
10190
strategy:
10291
matrix:
103-
docker-tag: ['stretch-2018-03-13', 'buster-2021-05-28', 'buster-legacy-2023-05-03']
92+
docker-tag: ['buster-2021-05-28', 'buster-legacy-2023-05-03', 'bullseye-2023-05-03']
10493
fail-fast: false
10594
services:
10695
rpios:
@@ -112,7 +101,7 @@ jobs:
112101
- name: Wait 2m30s for the docker image to start up QEMU and Raspberry Pi OS
113102
run: sleep 150
114103
- name: Clone project & setup it as the bash entry directory
115-
uses: appleboy/ssh-action@master
104+
uses: appleboy/ssh-action@v1.0.0
116105
with:
117106
host: rpios
118107
username: pi
@@ -126,18 +115,8 @@ jobs:
126115
git checkout --progress FETCH_HEAD
127116
echo "cd ~/mu" > ~/.bashrc_new && cat ~/.bashrc >> ~/.bashrc_new
128117
rm ~/.bashrc && mv ~/.bashrc_new ~/.bashrc
129-
# As Pi OS stretch is no longer supported the repository URL was moved and is no longer updated
130-
- name: Update Stretch sources.list
131-
if: ${{ matrix.docker-tag == 'stretch-2018-03-13' }}
132-
uses: appleboy/ssh-action@master
133-
with:
134-
host: rpios
135-
username: pi
136-
password: raspberry
137-
port: ${{ job.services.rpios.ports[5022] }}
138-
script: echo "deb http://legacy.raspbian.org/raspbian/ stretch main contrib non-free rpi" | sudo tee /etc/apt/sources.list
139118
- name: Install Mu extra apt dependencies
140-
uses: appleboy/ssh-action@master
119+
uses: appleboy/ssh-action@v1.0.0
141120
with:
142121
host: rpios
143122
username: pi
@@ -147,22 +126,24 @@ jobs:
147126
sudo apt-get update
148127
sudo apt-get install -y python3-virtualenv
149128
- name: Create venv and install Python dependencies
150-
uses: appleboy/ssh-action@master
129+
uses: appleboy/ssh-action@v1.0.0
151130
with:
152131
host: rpios
153132
username: pi
154133
password: raspberry
155134
port: ${{ job.services.rpios.ports[5022] }}
156135
command_timeout: 20m
136+
# Some compiled packages take a while to be built in piwheels, so to
137+
# avoid intermittent pip install failures we use `--prefer-binary`
157138
script: |
158139
python3 -m virtualenv ~/mu/.venv -v --python=python3 --system-site-packages
159140
echo "source ~/mu/.venv/bin/activate" > ~/.bashrc_new && cat ~/.bashrc >> ~/.bashrc_new
160141
rm ~/.bashrc && mv ~/.bashrc_new ~/.bashrc
161142
source .venv/bin/activate
162143
python -m pip list
163-
python -m pip install ."[dev]"
144+
python -m pip install ."[dev]" --prefer-binary
164145
- name: Environment info
165-
uses: appleboy/ssh-action@master
146+
uses: appleboy/ssh-action@v1.0.0
166147
with:
167148
host: rpios
168149
username: pi
@@ -175,12 +156,11 @@ jobs:
175156
python3 -m pip --version
176157
python3 -m pip list
177158
- name: Run tests
178-
uses: appleboy/ssh-action@master
159+
uses: appleboy/ssh-action@v1.0.0
179160
with:
180161
host: rpios
181162
username: pi
182163
password: raspberry
183164
port: ${{ job.services.rpios.ports[5022] }}
184-
# The time out can be decreased to 30 min when Stretch is dropped
185-
command_timeout: 45m
165+
command_timeout: 30m
186166
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: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,21 @@
2525
# The core 'install_requires' should only be things
2626
# which are needed for the main editor to function.
2727
#
28-
"PyQt5==5.13.2"
28+
"PyQt5==5.15.10"
2929
+ ';"arm" not in platform_machine and "aarch" not in platform_machine',
30-
"QScintilla==2.11.3"
30+
"QScintilla==2.14.1"
3131
+ ';"arm" not in platform_machine and "aarch" not in platform_machine',
32-
"PyQtChart==5.13.1"
32+
"PyQtChart==5.15.6"
3333
+ ';"arm" not in platform_machine and "aarch" not in platform_machine',
34-
# FIXME: jupyter-client added for Py3.5 compatibility, to be dropped after
35-
# Mu v1.1 release. So, qtconsole < 5 and jupyter-client < 6.2 (issue #1444)
36-
"jupyter-client>=4.1,<6.2",
37-
# FIXME: ipykernel max added for macOS 10.13 compatibility, min taken from
38-
# qtconsole 4.7.7. Full line can be removed after Mu v1.1 release.
39-
# Dependency mirrored for user venv in mu/wheels/__init__.py
40-
"ipykernel>=4.1,<6",
41-
# FIXME: ipykernel<6 depends on ipython_genutils, but it isn't explicitly
42-
# declared as a dependency. It also depends on traitlets, which
43-
# incidentally brought ipython_genutils, but in v5.1 it was dropped, so as
44-
# a workaround we need to manually specify it here.
45-
"ipython_genutils>=0.2.0",
46-
"qtconsole==4.7.7",
47-
#
34+
# ipykernel has to be < v6 for macOS 10.13 compatibility (v6 depends on
35+
# debugpy package), v5.5.6 resolves issue ipython/ipykernel#759.
36+
# Full line can be removed after Mu v1.3 release as PyQt6 drops old macOS.
37+
# ipykernel version has to be mirrored in mu/wheels/__init__.py
38+
"ipykernel>=5.5.6,<6",
39+
"qtconsole~=5.4",
40+
# In Python 3.12 the deprecated 'imp' module was removed from the stdlib.
41+
# ipykernel only moved to importlib in v6.10, so this is a "forward-port"
42+
"zombie_imp>=0.0.2;python_version>='3.12'",
4843
# adafruit-board-toolkit is used to find serial ports and help identify
4944
# CircuitPython boards in the CircuitPython mode.
5045
"adafruit-board-toolkit~=1.1",
@@ -58,7 +53,7 @@
5853
"flake8 >= 3.8.3",
5954
# Clamp click max version to workaround incompatibility with black<22.1.0
6055
"click<=8.0.4",
61-
"black>=19.10b0,<22.1.0;python_version>'3.5'",
56+
"black>=19.10b0,<22.1.0",
6257
"platformdirs>=2.0.0,<3.0.0",
6358
"semver>=2.8.0",
6459
# virtualenv vendors pip, we need at least pip v19.3 to install some
@@ -75,6 +70,9 @@
7570
# Needed to resolve an issue with paths in the user virtual environment
7671
#
7772
"pywin32; sys_platform=='win32'",
73+
# pkg_resources has been removed in Python 3.12, until we move to importlib
74+
# we need it via setuptools: https://github.com/mu-editor/mu/issues/2485
75+
"setuptools",
7876
]
7977

8078

@@ -128,7 +126,7 @@
128126
"mu.modes.api",
129127
"mu.wheels",
130128
],
131-
python_requires=">=3.5,<3.9",
129+
python_requires=">=3.7,<3.13",
132130
install_requires=install_requires,
133131
extras_require=extras_require,
134132
package_data={"mu.wheels": ["*.whl", "*.zip"]},
@@ -147,10 +145,12 @@
147145
"Operating System :: MacOS :: MacOS X",
148146
"Operating System :: Microsoft :: Windows",
149147
"Programming Language :: Python :: 3 :: Only",
150-
"Programming Language :: Python :: 3.5",
151-
"Programming Language :: Python :: 3.6",
152148
"Programming Language :: Python :: 3.7",
153149
"Programming Language :: Python :: 3.8",
150+
"Programming Language :: Python :: 3.9",
151+
"Programming Language :: Python :: 3.10",
152+
"Programming Language :: Python :: 3.11",
153+
"Programming Language :: Python :: 3.12",
154154
"Topic :: Education",
155155
"Topic :: Games/Entertainment",
156156
"Topic :: Software Development",

tests/interface/test_editor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,7 @@ def test_EditorPane_toggle_comments_handle_crlf_newline():
936936
"""
937937
ep = mu.interface.editor.EditorPane(None, "test\r\nline 2\n")
938938
ep.hasSelectedText = mock.MagicMock(return_value=False)
939+
ep.setCursorPosition(0, 0)
939940
ep.toggle_comments()
940941
assert ep.text() == "# test\nline 2\n"
941942
assert ep.selectedText() == "# test"

0 commit comments

Comments
 (0)