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

0 commit comments

Comments
 (0)