Skip to content

Commit

Permalink
Add support for Python 3.13 (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam authored Oct 25, 2024
1 parent a2371bc commit 20ef487
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 21 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/lint-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
# Ruff is version and platform sensible
matrix:
os: [windows-latest, ubuntu-22.04]
python-version: ["3.11", "3.12"]
python-version: ["3.11", "3.12", "3.13"]
steps:
- name: Checkout ${{ github.repository }}/${{ github.ref }}
uses: actions/checkout@v4
Expand All @@ -66,7 +66,7 @@ jobs:
# Pyright is version and platform sensible
matrix:
os: [windows-latest, ubuntu-22.04]
python-version: ["3.11", "3.12"]
python-version: ["3.11", "3.12", "3.13"]
steps:
- name: Checkout ${{ github.repository }}/${{ github.ref }}
uses: actions/checkout@v4
Expand Down Expand Up @@ -99,7 +99,10 @@ jobs:
# Only the Python version we plan on shipping matters.
matrix:
os: [windows-latest, ubuntu-22.04]
python-version: ["3.11", "3.12"]
python-version: ["3.12", "3.13"]
include:
- os: ubuntu-22.04
python-version: "3.11" # I had some Qt Wayland issues on 3.12 for ubuntu-22.04 iirc. TODO: test it
steps:
- name: Checkout ${{ github.repository }}/${{ github.ref }}
uses: actions/checkout@v4
Expand Down
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"configurations": [
{
"name": "Python: AutoSplit (debug non-user code)",
"type": "python",
"type": "debugpy",
"request": "launch",
"preLaunchTask": "Compile resources",
"program": "src/AutoSplit.py",
Expand All @@ -15,7 +15,7 @@
},
{
"name": "Python: AutoSplit",
"type": "python",
"type": "debugpy",
"request": "launch",
"preLaunchTask": "Compile resources",
"program": "src/AutoSplit.py",
Expand All @@ -24,7 +24,7 @@
},
{
"name": "Python: AutoSplit --auto-controlled",
"type": "python",
"type": "debugpy",
"request": "launch",
"preLaunchTask": "Compile resources",
"program": "src/AutoSplit.py",
Expand Down
1 change: 1 addition & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
; We don't run mypy in the CI. This is just to help anyone who would like to use it manually.
; Namely, the mypy_primer tool.
[mypy]
python_version = 3.11
show_column_numbers = true
mypy_path = $MYPY_CONFIG_FILE_DIR/typings
implicit_reexport = true
Expand Down
3 changes: 2 additions & 1 deletion scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ if ($IsWindows) {
$arguments += @(
# Installed by PyAutoGUI
'--exclude=pyscreeze'
# Installed by D3DShot
# Sometimes installed by other automation/image libraries.
# Keep this exclusion even if nothing currently installs it, to stay future-proof.
'--exclude=PIL')
}
if ($IsLinux) {
Expand Down
6 changes: 3 additions & 3 deletions scripts/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ If ($IsLinux) {
# PyAutoGUI: We only use it for hotkeys
&"$python" -m pip install PyAutoGUI --no-deps --upgrade

# Uninstall optional dependencies if PyAutoGUI or D3DShot was installed outside this script
# Uninstall optional dependencies if PyAutoGUI was installed outside this script
# PyScreeze -> pyscreenshot -> mss deps call SetProcessDpiAwareness, used to be installed on Windows
# Pillow, pygetwindow, pymsgbox, pytweening, MouseInfo are picked up by PySide6
# pygetwindow, pymsgbox, pytweening, MouseInfo are picked up by PyInstaller
# (also --exclude from build script, but more consistent with unfrozen run)
&"$python" -m pip uninstall pyscreenshot mss pygetwindow pymsgbox pytweening MouseInfo -y
If ($IsWindows) { &"$python" -m pip uninstall PyScreeze Pillow -y }
If ($IsWindows) { &"$python" -m pip uninstall PyScreeze -y }

# Don't compile resources on the Build CI job as it'll do so in build script
If ($dev) {
Expand Down
20 changes: 9 additions & 11 deletions scripts/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,28 @@
# Dependencies:
git+https://github.com/boppreh/keyboard.git#egg=keyboard # Fix install on macos and linux-ci https://github.com/boppreh/keyboard/pull/568
Levenshtein>=0.25
# Some modules used by OpenCV are not compiled for Numpy 2 yet on Linux. Error happens on import at runtime
numpy>=1.26,<2.0 # Python 3.12 support
opencv-python-headless>=4.9.0.80 # Typing fixes
numpy>=2.1 # Python 3.13 support
opencv-python-headless>=4.10 # NumPy 2 support
packaging
psutil>=5.9.6 # Python 3.12 fixes
# PyAutoGUI # See install.ps1
psutil>=6.0.0 # Python 3.13 support
# PyAutoGUI # See install.ps1
PyWinCtl>=0.0.42 # py.typed
# When needed, dev builds can be found at https://download.qt.io/snapshots/ci/pyside/dev?C=M;O=D
PySide6-Essentials>=6.6.0 # Python 3.12 support
scipy>=1.11.2 # Python 3.12 support
PySide6-Essentials>=6.8.0.2 # Python 3.13 support
scipy>=1.14.1 # Python 3.13 support
tomli-w>=1.1.0 # Typing fixes
typing-extensions>=4.4.0 # @override decorator support

#
# Build and compile resources
pyinstaller>=5.13 # Python 3.12 support
pyinstaller>=6.10.0 # Python 3.13 support

#
# https://peps.python.org/pep-0508/#environment-markers
#
# Windows-only dependencies:
comtypes<1.4.5 ; sys_platform == 'win32' # https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/807
pygrabber>=0.2 ; sys_platform == 'win32' # Completed types
pywin32>=301 ; sys_platform == 'win32'
pywin32>=307 ; sys_platform == 'win32' # Python 3.13 support
typed-D3DShot[numpy]>=1.0.1 ; sys_platform == 'win32'
winrt-Windows.Foundation>=2.2.0 ; sys_platform == 'win32' # Python 3.13 support
winrt-Windows.Graphics.Capture>=2.3.0 ; sys_platform == 'win32' # Python 3.13 support
Expand All @@ -42,5 +40,5 @@ winrt-Windows.Graphics.Imaging>=2.3.0 ; sys_platform == 'win32' # Python 3.13 s
#
# Linux-only dependencies
PyScreeze ; sys_platform == 'linux'
pillow ; sys_platform == 'linux' # Necessary for PyScreeze. For unknown reasons it's not pulled in on CI
pillow>=11.0 ; sys_platform == 'linux' # Python 3.13 support # Necessary for PyScreeze. For unknown reasons it's not pulled in on CI
python-xlib ; sys_platform == 'linux'

0 comments on commit 20ef487

Please sign in to comment.