Skip to content

Commit d8fa666

Browse files
Bump minimum Python version to match what we actually ship, reduce uv constraint size (#326)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent aea3748 commit d8fa666

22 files changed

+271
-3118
lines changed

.github/workflows/lint-and-build.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
# Pyright is version and platform sensible
5555
matrix:
5656
os: [windows-latest, ubuntu-22.04]
57-
python-version: ["3.11", "3.12", "3.13"]
57+
python-version: ["3.13"]
5858
steps:
5959
- uses: actions/checkout@v4
6060
- name: Set up uv for Python ${{ matrix.python-version }}
@@ -80,11 +80,6 @@ jobs:
8080
matrix:
8181
os: [windows-latest, ubuntu-22.04]
8282
python-version: ["3.13"]
83-
include:
84-
# I had some Qt Wayland issues on 3.12 for ubuntu-22.04
85-
# This should be fixed with QT_QPA_PLATFORM=xcb, but keeping it until next major upgrade
86-
- os: ubuntu-22.04
87-
python-version: "3.11"
8883
steps:
8984
- uses: actions/checkout@v4
9085
# region https://github.com/pyinstaller/pyinstaller/issues/9012

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repos:
1919
- id: pretty-format-ini
2020
args: [--autofix]
2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: v0.11.8 # Must match requirements-dev.txt
22+
rev: v0.11.13 # Must match requirements-dev.txt
2323
hooks:
2424
- id: ruff
2525
args: [--fix]

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<!-- markdownlint-disable-next-line MD033 -->
2+
23
# <img src="res/icon.ico" alt="LiveSplit" height="42" width="42" align="top"/> AutoSplit [![CodeQL](/../../actions/workflows/codeql-analysis.yml/badge.svg)](/../../actions/workflows/codeql-analysis.yml) [![Lint and build](/../../actions/workflows/lint-and-build.yml/badge.svg)](/../../actions/workflows/lint-and-build.yml)
34

45
[![SemVer](https://badgen.net/badge/_/SemVer%20compliant/grey?label)](https://semver.org/)
@@ -48,7 +49,7 @@ To understand how to use AutoSplit and how it works in-depth, please read the [t
4849
- Should work on Ubuntu 20.04+ (Only tested on Ubuntu 22.04)
4950
- Wayland is not currently supported
5051
- WSL2/WSLg requires an additional Desktop Environment, external X11 server, and/or systemd
51-
- Python 3.11+ (Not required for normal use. Refer to the [build instructions](/docs/build%20instructions.md) if you'd like run the application directly in Python).
52+
- If you'd like to run the project directly in Python from the source code, refer to the [build instructions](/docs/build%20instructions.md).
5253

5354
## Timer Integration
5455

@@ -130,6 +131,6 @@ Not a developer? You can still help through the following methods:
130131

131132
## Donate
132133

133-
If you enjoy using the program, please consider donating. Thank you!
134+
If you enjoy using the program, please consider donating. Thank you!
134135

135136
[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=BYRHQG69YRHBA&item_name=AutoSplit+development&currency_code=USD&source=url)

docs/build instructions.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ export UV_PROJECT_ENVIRONMENT=$(python3 -c "import sysconfig; print(sysconfig.ge
2121

2222
Read more: <https://docs.astral.sh/uv/concepts/projects/config/#project-environment-path>
2323

24+
Or you can create a separate environment then activate it:
25+
26+
```shell
27+
uv venv .venv-linux
28+
source .venv-linux/bin/activate
29+
```
30+
31+
All scripts pass the `--active` flag to make sure the active environment is used.
32+
2433
### All platforms
2534

2635
- [uv](https://docs.astral.sh/uv/getting-started/installation/)

mypy.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ disallow_incomplete_defs = false
3636
; exclude mypyc build
3737
exclude = .*(build)/.*
3838

39-
python_version = 3.11
4039
mypy_path = $MYPY_CONFIG_FILE_DIR/typings
4140
implicit_reexport = true
41+
allow_redefinition_new = true
42+
local_partial_types = true
4243

4344
; Auto-generated code, not much we can do there
4445
[mypy-gen.*]

pyproject.toml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "AutoSplit"
3-
dynamic = ["version"]
4-
requires-python = " >=3.11"
3+
version = "0"
4+
requires-python = ">=3.13"
55
dependencies = [
66
# Dependencies:
77
"Levenshtein >=0.25",
@@ -16,7 +16,6 @@ dependencies = [
1616
# "PySide6-Essentials >=6.8.2", # Fixed typing issue with QMessageBox.warning
1717
"scipy >=1.14.1", # Python 3.13 support
1818
"tomli-w >=1.1.0", # Typing fixes
19-
"typing-extensions >=4.4.0", # @override decorator support
2019

2120
#
2221
# Build and compile resources
@@ -50,9 +49,9 @@ dev = [
5049
"qt6-applications >=6.5.0",
5150
#
5251
# Linters & Formatters
53-
"mypy[faster-cache] >=1.14",
52+
"mypy[faster-cache] >=1.16",
5453
"pyright[nodejs] >=1.1.400", # reportPrivateImportUsage behaviour change
55-
"ruff >=0.11.8",
54+
"ruff >=0.11.13", # Must match .pre-commit-config.yaml
5655
#
5756
# Types
5857
"scipy-stubs >=1.14.1.1",
@@ -64,6 +63,11 @@ dev = [
6463
"types-pywin32 >=306.0.0.20240130; sys_platform == 'win32'",
6564
]
6665
[tool.uv]
66+
environments = [
67+
# AutoSplit does not currently support macOS
68+
"sys_platform == 'linux'",
69+
"sys_platform == 'win32'",
70+
]
6771
dependency-metadata = [
6872
# PyAutoGUI installs extra libraries we don't want. We only use it for hotkeys
6973
# PyScreeze -> pyscreenshot -> mss deps calls SetProcessDpiAwareness on Windows
@@ -76,7 +80,6 @@ keyboard = { git = "https://github.com/boppreh/keyboard.git" } # Fix install on
7680
# https://github.com/microsoft/pyright/blob/main/docs/configuration.md#sample-pyprojecttoml-file
7781
[tool.pyright]
7882
typeCheckingMode = "strict"
79-
pythonVersion = "3.11"
8083
# Prefer `pyright: ignore`
8184
enableTypeIgnoreComments = false
8285

ruff.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ ignore = [
3636
"SIM105", # flake8-simplify: use-contextlib-suppress
3737
# Negative performance impact and more verbose https://github.com/astral-sh/ruff/issues/7871
3838
"UP038", # non-pep604-isinstance
39+
# Not colored correctly in Pylance https://github.com/microsoft/pylance-release/issues/6942
40+
"UP047", # non-pep695-generic-function
3941
# Checked by type-checker (pyright/mypy)
4042
"ANN", # flake-annotations
4143
"PGH003", # blanket-type-ignore
@@ -113,6 +115,8 @@ allow-multiline = false
113115
[lint.isort]
114116
combine-as-imports = true
115117
split-on-trailing-comma = false
118+
# When ran through pre-commit, the src-based layout detection differs
119+
known-third-party = ["gen"]
116120

117121
# https://docs.astral.sh/ruff/settings/#mccabe
118122
[lint.mccabe]

src/AutoSplit.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,20 @@
3131
from copy import deepcopy
3232
from time import time
3333
from types import FunctionType
34-
from typing import NoReturn
34+
from typing import NoReturn, override
3535

3636
import cv2
3737
from cv2.typing import MatLike
38+
from gen import about, design, settings, update_checker
3839
from PySide6 import QtCore, QtGui
3940
from PySide6.QtTest import QTest
4041
from PySide6.QtWidgets import QApplication, QFileDialog, QLabel, QMainWindow, QMessageBox
41-
from typing_extensions import override
4242

4343
import error_messages
4444
import user_profile
4545
from AutoControlledThread import AutoControlledThread
4646
from AutoSplitImage import START_KEYWORD, AutoSplitImage, ImageType
4747
from capture_method import CaptureMethodBase, CaptureMethodEnum
48-
from gen import about, design, settings, update_checker
4948
from hotkeys import (
5049
HOTKEYS,
5150
KEYBOARD_GROUPS_ISSUE,

src/capture_method/BitBltCaptureMethod.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
if sys.platform != "win32":
44
raise OSError
55
import ctypes
6+
from typing import override
67

78
import numpy as np
89
import pywintypes
910
import win32con
1011
import win32gui
1112
import win32ui
1213
from cv2.typing import MatLike
13-
from typing_extensions import override
1414

1515
from capture_method.CaptureMethodBase import CaptureMethodBase
1616
from utils import BGRA_CHANNEL_COUNT, get_window_bounds, is_valid_hwnd, try_delete_dc

src/capture_method/DesktopDuplicationCaptureMethod.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22

33
if sys.platform != "win32":
44
raise OSError
5-
from typing import TYPE_CHECKING
5+
from typing import TYPE_CHECKING, override
66

77
import cv2
88
import d3dshot
99
import win32api
1010
import win32con
1111
import win32gui
12-
from typing_extensions import override
1312

1413
from capture_method.BitBltCaptureMethod import BitBltCaptureMethod
1514
from utils import GITHUB_REPOSITORY, get_window_bounds

src/capture_method/Screenshot using QT attempt.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
# ruff: noqa: RET504
21
import sys
32

43
if sys.platform != "linux":
54
raise OSError
6-
from typing import cast
5+
from typing import cast, override
76

87
import numpy as np
98
from cv2.typing import MatLike
109
from PySide6.QtCore import QBuffer, QIODeviceBase
1110
from PySide6.QtGui import QGuiApplication
12-
from typing_extensions import override
1311

1412
from capture_method.CaptureMethodBase import CaptureMethodBase
1513

@@ -33,4 +31,4 @@ def get_frame(self):
3331
frame = np.frombuffer(cast(MatLike, b), np.uint8).reshape((200, 200, 3))
3432

3533
# frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
36-
return frame
34+
return frame # noqa: RET504

src/capture_method/ScrotCaptureMethod.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
if sys.platform != "linux":
44
raise OSError
55

6+
from typing import override
7+
68
import cv2
79
import numpy as np
810
import pyscreeze
911
from pywinctl import getWindowsWithTitle
10-
from typing_extensions import override
1112
from Xlib.display import Display
1213
from Xlib.error import BadWindow
1314

src/capture_method/VideoCaptureDeviceCaptureMethod.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
from threading import Event, Thread
2-
from typing import TYPE_CHECKING
2+
from typing import TYPE_CHECKING, override
33

44
import cv2
55
import cv2.Error
66
import numpy as np
77
from cv2.typing import MatLike
8-
from typing_extensions import override
98

109
from capture_method.CaptureMethodBase import CaptureMethodBase
1110
from error_messages import CREATE_NEW_ISSUE_MESSAGE, exception_traceback

src/capture_method/WindowsGraphicsCaptureMethod.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
if sys.platform != "win32":
44
raise OSError
55
import asyncio
6-
from typing import TYPE_CHECKING, cast
6+
from typing import TYPE_CHECKING, cast, override
77

88
import numpy as np
99
import win32gui
1010
from cv2.typing import MatLike
11-
from typing_extensions import override
1211
from winrt.windows.graphics import SizeInt32
1312
from winrt.windows.graphics.capture import Direct3D11CaptureFramePool, GraphicsCaptureSession
1413
from winrt.windows.graphics.capture.interop import create_for_window

src/capture_method/XcbCaptureMethod.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
if sys.platform != "linux":
44
raise OSError
55

6+
from typing import override
7+
68
import cv2
79
import numpy as np
810
from PIL import ImageGrab
911
from pywinctl import getWindowsWithTitle
10-
from typing_extensions import override
1112
from Xlib.display import Display
1213
from Xlib.error import BadWindow
1314

src/capture_method/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
from dataclasses import dataclass
55
from enum import EnumMeta, StrEnum, auto, unique
66
from itertools import starmap
7-
from typing import TYPE_CHECKING, Never, TypedDict, cast
8-
9-
from typing_extensions import override
7+
from typing import TYPE_CHECKING, Never, TypedDict, cast, override
108

119
from capture_method.CaptureMethodBase import CaptureMethodBase
1210
from capture_method.VideoCaptureDeviceCaptureMethod import VideoCaptureDeviceCaptureMethod

src/menu_bar.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
import sys
33
import webbrowser
44
from functools import partial
5-
from typing import TYPE_CHECKING, Any, Literal, cast
5+
from typing import TYPE_CHECKING, Any, Literal, cast, override
66
from urllib.error import URLError
77
from urllib.request import urlopen
88

9+
from gen import about, design, settings as settings_ui, update_checker
910
from packaging.version import parse as version_parse
1011
from PySide6 import QtCore, QtWidgets
1112
from PySide6.QtCore import Qt
1213
from PySide6.QtGui import QBrush, QPalette
1314
from PySide6.QtWidgets import QFileDialog
14-
from typing_extensions import override
1515

1616
import error_messages
1717
import user_profile
@@ -22,7 +22,6 @@
2222
change_capture_method,
2323
get_all_video_capture_devices,
2424
)
25-
from gen import about, design, settings as settings_ui, update_checker
2625
from hotkeys import HOTKEYS, HOTKEYS_WHEN_AUTOCONTROLLED, CommandStr, set_hotkey
2726
from utils import AUTOSPLIT_VERSION, GITHUB_REPOSITORY, ONE_SECOND, decimal, fire_and_forget
2827

src/region_selection.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import sys
22
from math import ceil
3-
from typing import TYPE_CHECKING
3+
from typing import TYPE_CHECKING, override
44

55
import cv2
66
import numpy as np
77
from cv2.typing import MatLike, Point
88
from PySide6 import QtCore, QtGui, QtWidgets
99
from PySide6.QtTest import QTest
1010
from pywinctl import getTopWindowAt
11-
from typing_extensions import override
1211

1312
import error_messages
1413
from capture_method import Region

src/split_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __value_from_filename(
3636
delimiters: str,
3737
default_value: T,
3838
) -> T:
39-
if len(delimiters) != 2: # noqa: PLR2004
39+
if len(delimiters) != 2:
4040
raise ValueError("delimiters parameter must contain exactly 2 characters")
4141
try:
4242
string_value = filename.split(delimiters[0], 1)[1].split(delimiters[1])[0]

src/user_profile.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import os
22
import tomllib
33
from copy import deepcopy
4-
from typing import TYPE_CHECKING, NoReturn, TypedDict, cast
4+
from typing import TYPE_CHECKING, NoReturn, TypedDict, cast, override
5+
from warnings import deprecated
56

67
import tomli_w
8+
from gen import design
79
from PySide6 import QtCore, QtWidgets
8-
from typing_extensions import deprecated, override
910

1011
import error_messages
1112
from capture_method import CAPTURE_METHODS, CaptureMethodEnum, Region, change_capture_method
12-
from gen import design
1313
from hotkeys import HOTKEYS, CommandStr, Hotkey, remove_all_hotkeys, set_hotkey
1414
from menu_bar import open_settings
1515
from utils import auto_split_directory

0 commit comments

Comments
 (0)