Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import re
import time
from urllib.request import urlretrieve

project = 'PyWinBox'
year = time.strftime("%Y")
Expand Down Expand Up @@ -42,8 +43,6 @@

# -- Copy the modules documentation ------------------------------------------
# https://stackoverflow.com/questions/66495200/is-it-possible-to-include-external-rst-files-in-my-documentation
from urllib.request import urlretrieve

urlretrieve(
"https://raw.githubusercontent.com/kalmat/pywinbox/master/README.md",
"index.md"
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ docs = ["myst-parser"]
dev = [
{ include-group = "docs" },
"ruff>=0.15.16",
"ewmhlib", # Get type information even when not working on Linux
"pywinctl>=0.3",
"mypy>=0.990,<2",
"types-python-xlib>=0.32",
Expand Down
5 changes: 0 additions & 5 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ ignore = [
# TODO: Consider later
"UP031", # printf-string-formatting
"RUF059", # unused-unpacked-variable

# TODO: Not autofixable, address in a separate PR !
"E402",
"E722",
"PYI063",
]
# F401 would remove imports not marked as explicit re-exports, which may break API boundaries
extend-unsafe-fixes = ["F401"]
Expand Down
9 changes: 4 additions & 5 deletions src/pywinbox/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/usr/bin/python
from importlib.metadata import version as _importlib_version

from ._main import (Box, Rect, Point, Size,
PyWinBox, WindowBox, ScreenBox,
pointInBox, collidepoint, collidebox, contains, clip, union)

__all__ = [
"version",
"Box", "Rect", "Point", "Size",
Expand All @@ -14,8 +18,3 @@
def version(numberOnly: bool = True) -> str:
"""Returns the current version of PyWinBox module, in the form ''x.x.xx'' as string"""
return ("" if numberOnly else "PyWinBox-")+__version__


from ._main import (Box, Rect, Point, Size,
PyWinBox, WindowBox, ScreenBox,
pointInBox, collidepoint, collidebox, contains, clip, union)
5 changes: 3 additions & 2 deletions src/pywinbox/_pywinbox_linux.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/usr/bin/python
from __future__ import annotations

import os
import sys
assert sys.platform == "linux"

if sys.platform != "linux":
raise OSError(f"Cannot import {__name__} on {sys.platform}")

import os
from Xlib.xobject.drawable import Window as XWindow

from ._main import Box
Expand Down
3 changes: 2 additions & 1 deletion src/pywinbox/_pywinbox_macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

import sys

assert sys.platform == "darwin"
if sys.platform != "darwin":
raise OSError(f"Cannot import {__name__} on {sys.platform}")

import subprocess
from typing import NamedTuple, cast
Expand Down
4 changes: 2 additions & 2 deletions src/pywinbox/_pywinbox_win.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import sys

assert sys.platform == "win32"

if sys.platform != "win32":
raise OSError(f"Cannot import {__name__} on {sys.platform}")

import ctypes
import win32gui
Expand Down
5 changes: 4 additions & 1 deletion tests/test_MacNSBox.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/usr/bin/env python
# Lawrence Akka - https://sourceforge.net/p/pyobjc/mailman/pyobjc-dev/thread/0B4BC391-6491-445D-92D0-7B1CEF6F51BE%40me.com/#msg27726282

import os
import sys
if sys.platform != "darwin":
raise OSError(f"Cannot import {__name__} on {sys.platform}")

import os
import time
import traceback

Expand Down
2 changes: 1 addition & 1 deletion tests/test_pywinbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class GetWindowKwargs(TypedDict):
title: str
condition: int
condition: int # TODO: Consider making pywinctl.Re an IntEnum


def test_basic() -> None:
Expand Down
2 changes: 1 addition & 1 deletion typings/Quartz/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ from Quartz.QuartzCore import *
from Quartz.QuartzFilters import *
from Quartz.QuickLookUI import *

def __getattr__(__name: str) -> Any: ...
def __getattr__(name: str, /) -> Any: ...
2,330 changes: 1,166 additions & 1,164 deletions uv.lock

Large diffs are not rendered by default.

Loading