diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0999d7..deadfce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,16 +7,12 @@ on: - master paths: - ".github/workflows/ci.yml" - - "docs/**" - - ".readthedocs.yaml" - "pyproject.toml" - "mypy.ini" - "**/*.py" pull_request: paths: - ".github/workflows/ci.yml" - - "docs/**" - - ".readthedocs.yaml" - "pyproject.toml" - "mypy.ini" - "**/*.py" @@ -61,7 +57,7 @@ jobs: # Test on all supported runtime combinations matrix: # Arm runners are faster (as long as the same wheels are available) - # PyWinCtl doesn't have any code that should act differently per architecture + # This project doesn't have any code that should act differently per architecture os: [windows-11-arm, ubuntu-24.04-arm, macos-latest] # TODO: Run tests in parallel on free-threaded python to catch free-threading issues # See: https://py-free-threading.github.io/testing/ diff --git a/CHANGES.txt b/CHANGES.txt index 95d6fe0..4814383 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,6 @@ -0.4.02, 2026/06/16 -- ALL: Replaced bare `except:` clauses with `except Exception:`, preventing accidental suppression of system-exit signals (KeyboardInterrupt, SystemExit) during error handling. - ALL: Fixed WatchDog.stop() not joining the worker thread. Known to have been causing Xlib race conditions on Linux +0.5, 2026/XX/XX -- ALL: Replaced bare `except:` clauses with `except Exception:`, preventing accidental suppression of system-exit signals (KeyboardInterrupt, SystemExit) during error handling. + ALL: Fixed WatchDog.stop() not joining the worker thread. Known to have been causing Xlib race conditions on Linux + ALL: Removed runtime dependency on `typing_extensions` 0.4.01, 2024/09/22 -- ALL: Added getAllWindowsDict() general function. Added getPID() method. LINUX: Added bad window filter to check for window.id == 0 0.4, 2023/10/11 -- ALL: Added getMonitor() as alias for getDisplay() diff --git a/pyproject.toml b/pyproject.toml index 146600b..a6a2075 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,7 +68,6 @@ dependencies = [ "python-xlib>=0.21; sys_platform == 'linux'", "pywin32>=302; sys_platform == 'win32'", "pywinbox>=0.7", - "typing_extensions>=4.4.0", ] [dependency-groups] @@ -82,6 +81,7 @@ dev = [ "ruff>=0.15.16", "types-python-xlib>=0.32", "types-pywin32>=305.0.0.3", + "typing_extensions>=4.4.0", ] [tool.uv] diff --git a/src/pywinctl/_main.py b/src/pywinctl/_main.py index bcb01d6..6991f5d 100644 --- a/src/pywinctl/_main.py +++ b/src/pywinctl/_main.py @@ -1054,4 +1054,3 @@ class _WINDICT(TypedDict): # noqa: PYI049 # Private symbol imported by internal "PyWinCtl currently does not support this platform. " + "If you think you can help, please contribute! https://github.com/Kalmat/PyWinCtl" ) -Window = Window diff --git a/src/pywinctl/_pywinctl_macos.py b/src/pywinctl/_pywinctl_macos.py index b83dc82..d70cadb 100644 --- a/src/pywinctl/_pywinctl_macos.py +++ b/src/pywinctl/_pywinctl_macos.py @@ -15,10 +15,8 @@ import subprocess import threading import time -from collections.abc import Iterable -from typing import Any, cast, ClassVar -from collections.abc import Sequence -from typing_extensions import TypeAlias, TypedDict, Literal +from collections.abc import Iterable, Sequence +from typing import Any, cast, ClassVar, TYPE_CHECKING, TypedDict, Literal import AppKit import Quartz @@ -26,6 +24,8 @@ from ._main import BaseWindow, Re, _WatchDog, _findMonitorName, _WINDATA, _WINDICT from pywinbox import Size, Point, Rect, pointInBox +if TYPE_CHECKING: + from typing_extensions import TypeAlias Incomplete: TypeAlias = Any Attribute: TypeAlias = Sequence['tuple[str, str, bool, str]'] diff --git a/src/pywinctl/_pywinctl_win.py b/src/pywinctl/_pywinctl_win.py index c725939..5a6795a 100644 --- a/src/pywinctl/_pywinctl_win.py +++ b/src/pywinctl/_pywinctl_win.py @@ -12,9 +12,7 @@ import time from collections.abc import Sequence from ctypes import wintypes -from typing import cast, Any, TYPE_CHECKING -from typing_extensions import NotRequired, TypedDict - +from typing import cast, Any, TYPE_CHECKING, TypedDict import win32gui_struct import win32process @@ -27,6 +25,7 @@ from pywinbox import Size, Point, Rect, pointInBox if TYPE_CHECKING: + from typing_extensions import NotRequired from win32.lib.win32gui_struct import _MENUITEMINFO, _MENUINFO # WARNING: Changes are not immediately applied, specially for hide/show (unmap/map) diff --git a/uv.lock b/uv.lock index 6dece52..84dabfc 100644 --- a/uv.lock +++ b/uv.lock @@ -8325,7 +8325,6 @@ dependencies = [ { name = "python-xlib", marker = "sys_platform == 'linux'" }, { name = "pywin32", marker = "sys_platform == 'win32'" }, { name = "pywinbox" }, - { name = "typing-extensions" }, ] [package.dev-dependencies] @@ -8340,6 +8339,7 @@ dev = [ { name = "types-python-xlib", version = "0.33.0.20250809", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" }, { name = "types-python-xlib", version = "0.33.0.20260518", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10'" }, { name = "types-pywin32" }, + { name = "typing-extensions" }, ] docs = [ { name = "myst-parser", version = "1.0.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" }, @@ -8355,7 +8355,6 @@ requires-dist = [ { name = "python-xlib", marker = "sys_platform == 'linux'", specifier = ">=0.21" }, { name = "pywin32", marker = "sys_platform == 'win32'", specifier = ">=302" }, { name = "pywinbox", specifier = ">=0.7" }, - { name = "typing-extensions", specifier = ">=4.4.0" }, ] [package.metadata.requires-dev] @@ -8366,6 +8365,7 @@ dev = [ { name = "ruff", specifier = ">=0.15.16" }, { name = "types-python-xlib", specifier = ">=0.32" }, { name = "types-pywin32", specifier = ">=305.0.0.3" }, + { name = "typing-extensions", specifier = ">=4.4.0" }, ] docs = [{ name = "myst-parser" }]