Skip to content

Commit 29cd2db

Browse files
build(deps): bump ruff from 0.11.11 to 0.12.8 (#393)
* build(deps): bump ruff from 0.11.11 to 0.12.8 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.11.11 to 0.12.8. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](astral-sh/ruff@0.11.11...0.12.8) --- updated-dependencies: - dependency-name: ruff dependency-version: 0.12.8 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * fixes --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Mickaël Schoentgen <[email protected]>
1 parent 78fff32 commit 29cd2db

File tree

5 files changed

+11
-15
lines changed

5 files changed

+11
-15
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ mss = "mss.__main__:main"
7373
dev = [
7474
"build==1.3.0",
7575
"mypy==1.17.1",
76-
"ruff==0.11.11",
76+
"ruff==0.12.9",
7777
"twine==6.1.0",
7878
]
7979
docs = [

src/mss/factory.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ def mss(**kwargs: Any) -> MSSBase:
2222
os_ = platform.system().lower()
2323

2424
if os_ == "darwin":
25-
from mss import darwin
25+
from mss import darwin # noqa: PLC0415
2626

2727
return darwin.MSS(**kwargs)
2828

2929
if os_ == "linux":
30-
from mss import linux
30+
from mss import linux # noqa: PLC0415
3131

3232
return linux.MSS(**kwargs)
3333

3434
if os_ == "windows":
35-
from mss import windows
35+
from mss import windows # noqa: PLC0415
3636

3737
return windows.MSS(**kwargs)
3838

src/tests/test_implementation.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
from __future__ import annotations
66

77
import os
8-
import os.path
98
import platform
109
import sys
10+
import threading
11+
import time
1112
from datetime import datetime
1213
from pathlib import Path
1314
from typing import TYPE_CHECKING
@@ -16,7 +17,6 @@
1617
import pytest
1718

1819
import mss
19-
import mss.tools
2020
from mss.__main__ import main as entry_point
2121
from mss.base import MSSBase
2222
from mss.exception import ScreenShotError
@@ -237,8 +237,6 @@ def test_grab_with_tuple_percents() -> None:
237237

238238
def test_thread_safety() -> None:
239239
"""Regression test for issue #169."""
240-
import threading
241-
import time
242240

243241
def record(check: dict) -> None:
244242
"""Record for one second."""

src/tests/test_leaks.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
Source: https://github.com/BoboTiG/python-mss.
33
"""
44

5+
import ctypes
56
import os
67
import platform
8+
import subprocess
79
from collections.abc import Callable
810

911
import pytest
@@ -18,8 +20,6 @@ def get_opened_socket() -> int:
1820
"""GNU/Linux: a way to get the opened sockets count.
1921
It will be used to check X server connections are well closed.
2022
"""
21-
import subprocess
22-
2323
cmd = f"lsof -U | grep {PID}"
2424
output = subprocess.check_output(cmd, shell=True)
2525
return len(output.splitlines())
@@ -29,8 +29,6 @@ def get_handles() -> int:
2929
"""Windows: a way to get the GDI handles count.
3030
It will be used to check the handles count is not growing, showing resource leaks.
3131
"""
32-
import ctypes
33-
3432
PROCESS_QUERY_INFORMATION = 0x400 # noqa:N806
3533
GR_GDIOBJECTS = 0 # noqa:N806
3634
h = ctypes.windll.kernel32.OpenProcess(PROCESS_QUERY_INFORMATION, 0, PID)

src/tests/test_setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
pytest.importorskip("build")
1818
pytest.importorskip("twine")
1919

20-
SDIST = "python -m build --sdist".split()
21-
WHEEL = "python -m build --wheel".split()
22-
CHECK = "twine check --strict".split()
20+
SDIST = ["python", "-m", "build", "--sdist"]
21+
WHEEL = ["python", "-m", "build", "--wheel"]
22+
CHECK = ["twine", "check", "--strict"]
2323

2424

2525
def test_sdist() -> None:

0 commit comments

Comments
 (0)