diff --git a/.github/workflows/lint-and-build.yml b/.github/workflows/lint-and-build.yml index 414cc845..0ca3caff 100644 --- a/.github/workflows/lint-and-build.yml +++ b/.github/workflows/lint-and-build.yml @@ -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 @@ -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 @@ -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 diff --git a/.vscode/launch.json b/.vscode/launch.json index 957b8d50..270f80e1 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -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", @@ -15,7 +15,7 @@ }, { "name": "Python: AutoSplit", - "type": "python", + "type": "debugpy", "request": "launch", "preLaunchTask": "Compile resources", "program": "src/AutoSplit.py", @@ -24,7 +24,7 @@ }, { "name": "Python: AutoSplit --auto-controlled", - "type": "python", + "type": "debugpy", "request": "launch", "preLaunchTask": "Compile resources", "program": "src/AutoSplit.py", diff --git a/mypy.ini b/mypy.ini index 346c90b6..7a8a4815 100644 --- a/mypy.ini +++ b/mypy.ini @@ -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 @@ -22,8 +23,3 @@ exclude = .*(build)/.* ; Auto-generated code, not much we can do there [mypy-gen.*] disable_error_code = attr-defined, arg-type - -; Of course my stubs are going to be incomplete. Otherwise they'd be on typeshed! -; Mypy becomes really whack with its errors inside these stubs though -[mypy-scipy.*] -disable_error_code = attr-defined, import-untyped diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 3d416c9f..3dd62f23 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -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) { diff --git a/scripts/install.ps1 b/scripts/install.ps1 index f7bd1bcd..ef55a7ea 100644 --- a/scripts/install.ps1 +++ b/scripts/install.ps1 @@ -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) { diff --git a/scripts/requirements-dev.txt b/scripts/requirements-dev.txt index dd8ca3bf..cf1cde59 100644 --- a/scripts/requirements-dev.txt +++ b/scripts/requirements-dev.txt @@ -15,6 +15,7 @@ ruff>=0.8.0 # Pre-commit fix # Must match .pre-commit-config.yaml # # Types +scipy-stubs>=1.14.1.1 types-keyboard types-psutil types-PyAutoGUI diff --git a/scripts/requirements.txt b/scripts/requirements.txt index 69d458a5..ad83222b 100644 --- a/scripts/requirements.txt +++ b/scripts/requirements.txt @@ -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 @@ -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' diff --git a/typings/scipy/__init__.pyi b/typings/scipy/__init__.pyi deleted file mode 100644 index 4b94936a..00000000 --- a/typings/scipy/__init__.pyi +++ /dev/null @@ -1,55 +0,0 @@ -from numpy.fft import ifft as ifft -from numpy.random import rand as rand, randn as randn -from scipy import ( - cluster, - constants, - datasets, - fft, - fftpack, - integrate, - interpolate, - io, - linalg, - misc, - ndimage, - odr, - optimize, - signal, - sparse, - spatial, - special, - stats, -) -from scipy.__config__ import show as show_config -from scipy._lib._ccallback import LowLevelCallable -from scipy._lib._testutils import PytestTester -from scipy.version import version as __version__ - -__all__ = [ - "LowLevelCallable", - "__version__", - "cluster", - "constants", - "datasets", - "fft", - "fftpack", - "integrate", - "interpolate", - "io", - "linalg", - "misc", - "ndimage", - "odr", - "optimize", - "show_config", - "signal", - "sparse", - "spatial", - "special", - "stats", - "test", -] - -test: PytestTester - -def __dir__() -> list[str]: ... diff --git a/typings/scipy/fft/__init__.pyi b/typings/scipy/fft/__init__.pyi deleted file mode 100644 index d27753fe..00000000 --- a/typings/scipy/fft/__init__.pyi +++ /dev/null @@ -1,72 +0,0 @@ -from numpy.fft import fftfreq, fftshift, ifftshift, rfftfreq -from scipy._lib._testutils import PytestTester -from scipy.fft._backend import register_backend, set_backend, set_global_backend, skip_backend -from scipy.fft._basic import ( - fft, - fft2, - fftn, - hfft, - hfft2, - hfftn, - ifft, - ifft2, - ifftn, - ihfft, - ihfft2, - ihfftn, - irfft, - irfft2, - irfftn, - rfft, - rfft2, - rfftn, -) -from scipy.fft._fftlog import fhtoffset -from scipy.fft._fftlog_multimethods import fht, ifht -from scipy.fft._helper import next_fast_len -from scipy.fft._pocketfft.helper import get_workers, set_workers -from scipy.fft._realtransforms import dct, dctn, dst, dstn, idct, idctn, idst, idstn - -__all__ = [ - "dct", - "dctn", - "dst", - "dstn", - "fft", - "fft2", - "fftfreq", - "fftn", - "fftshift", - "fht", - "fhtoffset", - "get_workers", - "hfft", - "hfft2", - "hfftn", - "idct", - "idctn", - "idst", - "idstn", - "ifft", - "ifft2", - "ifftn", - "ifftshift", - "ifht", - "ihfft", - "ihfft2", - "ihfftn", - "irfft", - "irfft2", - "irfftn", - "next_fast_len", - "register_backend", - "rfft", - "rfft2", - "rfftfreq", - "rfftn", - "set_backend", - "set_global_backend", - "set_workers", - "skip_backend", -] -test: PytestTester diff --git a/typings/scipy/fft/_realtransforms.pyi b/typings/scipy/fft/_realtransforms.pyi deleted file mode 100644 index 5d4a5c9e..00000000 --- a/typings/scipy/fft/_realtransforms.pyi +++ /dev/null @@ -1,88 +0,0 @@ -from typing import Literal - -from numpy import float64, generic -from numpy.typing import NDArray - -__all__ = ["dct", "dctn", "dst", "dstn", "idct", "idctn", "idst", "idstn"] - -def dctn( - x, - type=2, - s=None, - axes=None, - norm=None, - overwrite_x=False, - workers=None, - *, - orthogonalize=None, -): ... -def idctn( - x, - type=2, - s=None, - axes=None, - norm=None, - overwrite_x=False, - workers=None, - orthogonalize=None, -): ... -def dstn( - x, - type=2, - s=None, - axes=None, - norm=None, - overwrite_x=False, - workers=None, - orthogonalize=None, -): ... -def idstn( - x, - type=2, - s=None, - axes=None, - norm=None, - overwrite_x=False, - workers=None, - orthogonalize=None, -): ... -def dct( - x: NDArray[generic], - type: Literal[1, 2, 3, 4] = 2, - n: int | None = None, - axis: int = -1, - norm: Literal["backward", "ortho", "forward"] | None = None, - overwrite_x: bool = False, - workers: int | None = None, - orthogonalize: bool | None = None, -) -> NDArray[float64]: ... -def idct( - x, - type=2, - n=None, - axis=-1, - norm=None, - overwrite_x=False, - workers=None, - orthogonalize=None, -): ... -def dst( - x, - type=2, - n=None, - axis=-1, - norm=None, - overwrite_x=False, - workers=None, - orthogonalize=None, -): ... -def idst( - x, - type=2, - n=None, - axis=-1, - norm=None, - overwrite_x=False, - workers=None, - orthogonalize=None, -): ... diff --git a/typings/scipy/py.typed b/typings/scipy/py.typed deleted file mode 100644 index b648ac92..00000000 --- a/typings/scipy/py.typed +++ /dev/null @@ -1 +0,0 @@ -partial