Skip to content

Commit 4adff1d

Browse files
authored
Update python to 3.13 and update dependencies (#1720)
1 parent 006c7df commit 4adff1d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+463
-409
lines changed

.github/workflows/ci.yml

Lines changed: 185 additions & 82 deletions
Large diffs are not rendered by default.

.github/workflows/ci/helpers.sh

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ setup_cache_name()
3737
if [ "$RUNNER_OS" = 'macOS' ]
3838
then
3939
. ./osx/deps.sh
40-
[ "$target_python" = "${py_installer_version%.*}" ] || die 1 "versions mismatch: target=$target_python, installer=$py_installer_version"
40+
[ "$target_python" = "$py_installer_version" ] || die 1 "versions mismatch: target=$target_python, installer=$py_installer_version"
4141
target_python="$py_installer_version"
4242
fi
4343
cache_name=$("$python" - "$GITHUB_JOB" "$target_python" "$platform_name" <<\EOF
@@ -66,7 +66,7 @@ setup_osx_python()
6666
{
6767
target_python="$1"
6868
. ./osx/deps.sh
69-
[ "$target_python" = "${py_installer_version%.*}" ] || die 1 "versions mismatch: target=$target_python, installer=$py_installer_version"
69+
[ "$target_python" = "$py_installer_version" ] || die 1 "versions mismatch: target=$target_python, installer=$py_installer_version"
7070
python='python3'
7171
python_dir="$cache_dir/python"
7272
if [ ! -e "$python_dir" ]
@@ -76,31 +76,12 @@ setup_osx_python()
7676
fi
7777
# Update PATH.
7878
run_eval "echo \"\$PWD/$python_dir/Python.framework/Versions/Current/bin\" >>\$GITHUB_PATH"
79-
# Target High Sierra.
80-
run_eval "echo MACOSX_DEPLOYMENT_TARGET=10.13 >>\$GITHUB_ENV"
79+
run_eval "echo MACOSX_DEPLOYMENT_TARGET=12.0 >>\$GITHUB_ENV"
8180
# Fix SSL certificates so plover_build_utils.download works.
8281
SSL_CERT_FILE="$("$python" -m pip._vendor.certifi)" || die
8382
run_eval "echo SSL_CERT_FILE='$SSL_CERT_FILE' >>\$GITHUB_ENV"
8483
}
8584
86-
setup_pip_options()
87-
{
88-
# If the wheels cache is available, disable pip's index.
89-
if [ -e "$wheels_cache" ]
90-
then
91-
run_eval "echo PIP_NO_INDEX=1 >>\$GITHUB_ENV"
92-
else
93-
run mkdir -p "$wheels_cache"
94-
fi
95-
if [ "$RUNNER_OS" = 'Windows' ]
96-
then
97-
PIP_FIND_LINKS="$(cygpath -a -w "$wheels_cache")" || die
98-
else
99-
PIP_FIND_LINKS="$PWD/$wheels_cache"
100-
fi
101-
run_eval "echo PIP_FIND_LINKS='$PIP_FIND_LINKS' >>\$GITHUB_ENV"
102-
}
103-
10485
setup_python_env()
10586
{
10687
python_userbase="$cache_dir/python_userbase"
@@ -133,8 +114,8 @@ publish_github_release()
133114
title="$tag"
134115
is_draft='yes'
135116
is_prerelease="$("$python" <<EOF
136-
from pkg_resources import parse_version
137-
version = parse_version('$RELEASE_VERSION')
117+
from packaging.version import parse
118+
version = parse('$RELEASE_VERSION')
138119
print('1' if version.is_prerelease else '')
139120
EOF
140121
)" || die
@@ -183,10 +164,10 @@ EOF
183164
head -n20 <<<"$last_release"
184165
run_eval "last_version=\"\$(echo -n \"\$last_release\" | sed -n '/^# \\w\\+ \\([^ ]\\+\\)\$/{s//\\1/;P;Q0};\$Q1')\""
185166
if python <<EOF
186-
from pkg_resources import parse_version
167+
from packaging.version import parse
187168
import sys
188-
version = parse_version('$RELEASE_VERSION')
189-
last_version = parse_version('$last_version')
169+
version = parse('$RELEASE_VERSION')
170+
last_version = parse('$last_version')
190171
sys.exit(0 if version < last_version else 1)
191172
EOF
192173
then

.github/workflows/ci/workflow_context.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,21 @@ action_download_artifact: actions/download-artifact@v4
88

99
skippy_enabled: true
1010

11+
default_python: 3.13.3
12+
1113
vars:
1214
- &dist_linux
1315
variant: Linux
14-
python: "3.9"
1516
os: Linux
1617
platform: ubuntu-22.04
1718

1819
- &dist_macos
1920
variant: macOS
20-
python: "3.9"
2121
os: macOS
2222
platform: macos-15
2323

2424
- &dist_win
2525
variant: Windows
26-
python: "3.9"
2726
os: Windows
2827
platform: windows-2022
2928

@@ -51,9 +50,14 @@ jobs:
5150
- &python_test
5251
<<: *test
5352
<<: *dist_other
54-
variant: Python 3.8
55-
python: "3.8"
53+
variant: Python Latest Supported
5654
skiplists: ["job_test", "os_linux", "os_macos", "os_windows"]
55+
- <<: *python_test
56+
variant: Python 3.12
57+
python: "3.12"
58+
- <<: *python_test
59+
variant: Python 3.11
60+
python: "3.11"
5761
- <<: *python_test
5862
variant: Python 3.10
5963
python: "3.10"
@@ -70,7 +74,6 @@ jobs:
7074
- <<: *dist_other
7175
type: test_packaging
7276
variant: Packaging
73-
python: "3.9"
7477
reqs: ["packaging", "setup"]
7578
skiplists: ["job_test_packaging"]
7679

.github/workflows/ci/workflow_generate.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ def fetch_anchor(self):
4545
j['needs'] = j.get('needs', [])
4646
j['reqs'] = ['reqs/%s.txt' % r for r in j['reqs']]
4747
j['cache_extra_deps'] = j.get('cache_extra_deps', [])
48+
if 'python' not in j:
49+
j['python'] = context['default_python']
50+
4851
if context['skippy_enabled']:
4952
# Path to the "skip_cache" file.
5053
j['skip_cache_path'] = '.skip_cache_{id}'.format(**j)

.github/workflows/ci/workflow_template.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,6 @@ jobs:
120120
path: .cache
121121
key: <@ cache_epoch @>_${{ steps.set_cache.outputs.cache_name }}_${{ hashFiles('reqs/constraints.txt'<% for d in (j.reqs + j.cache_extra_deps) %><@ ', %r' % d @><% endfor %>) }}
122122

123-
- name: Setup pip options
124-
run: setup_pip_options
125-
126123
<% if j.os == 'macOS' %>
127124
# To support older macOS versions, setup Python from an official installer.
128125
- name: Setup Python
@@ -288,11 +285,10 @@ jobs:
288285
- name: Checkout
289286
uses: <@ action_checkout @>
290287

291-
# FIXME pass python version via workflow_context
292288
- name: Setup Python
293289
uses: <@ action_setup_python @>
294290
with:
295-
python-version: 3.9
291+
python-version: <@ default_python @>
296292

297293
- name: Install dependencies
298294
run: |

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ version: 2
66
build:
77
os: ubuntu-22.04
88
tools:
9-
python: "3.8"
9+
python: "3.9"
1010

1111
python:
1212
install:

doc/api/oslayer_config.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,3 @@ The full path name of the Plover configuration file.
6161
6262
The directory containing Plover's assets, such as icons and dictionaries.
6363
```
64-
65-
```{data} plover_dist
66-
:type: pkg_resources.DistInfoDistribution
67-
68-
A {class}`pkg_resources.DistInfoDistribution` containing information about
69-
Plover's base distribution, such as resource paths and package metadata.
70-
```
71-
72-
```{data} HAS_GUI_QT
73-
:type: bool
74-
75-
`True` if Plover supports the Qt-based GUI and Qt is installed,
76-
`False` otherwise.
77-
```

doc/api/registry.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ This method does not get called automatically upon instantiating a Registry
4242
object, so make sure to call it before using any plugins.
4343
```
4444
45-
```{method} register_plugin_from_entrypoint(plugin_type: str, entrypoint: pkg_resources.EntryPoint)
45+
```{method} register_plugin_from_entrypoint(plugin_type: str, entrypoint: importlib.metadata.EntryPoint)
4646
Adds a plugin of the specified type discovered through the entry point
4747
mechanism to the registry.
4848
```
@@ -86,13 +86,9 @@ function, class, or module.
8686

8787
````{class} PluginDistribution(dist, plugins)
8888
```{attribute} dist
89-
:type: pkg_resources.Distribution
89+
:type: str
9090
91-
A [`Distribution`](https://setuptools.readthedocs.io/en/latest/pkg_resources.html#distribution-objects)
92-
providing information on a single package either
93-
bundled with Plover, or installed from the plugins manager, for
94-
example, the main Plover package `plover 4.0.0-dev12`. Each
95-
distribution may contain multiple plugins.
91+
A string representing the entry point group of the distribution plugin.
9692
```
9793
9894
```{attribute} plugins

doc/developer_guide.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Environment setup
22

3-
You need Python >= 3.8 installed, and you need [tox](https://pypi.org/project/tox/) >= 4.0.
3+
You need Python >= 3.10 installed, and you need [tox](https://pypi.org/project/tox/) >= 4.0.
4+
It is recommended to install the same Python version that is packaged in the official installer files.
5+
You can look up this version in the file `.github/workflows/ci/workflow_context.yml` in the vars section.
46

57
Tox simplifies the process of creating and managing isolated virtual environments,
68
handling dependency installation, and running the test suite in isolation. This

news.d/bugfix/1728.linux.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Fix keys getting stuck if keys held when starting Plover and emulating keyboard with Uinput
1+
Fix keys getting stuck if keys held when starting Plover and emulating keyboard with Uinput.

0 commit comments

Comments
 (0)