Skip to content

Commit 233f5b1

Browse files
authored
fix: drop Python 3.9 support (#508)
1 parent 576c32f commit 233f5b1

13 files changed

Lines changed: 1012 additions & 1409 deletions

File tree

.github/workflows/tests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ jobs:
6363
- emoji: 🪟
6464
runs-on: [windows-latest]
6565
python:
66-
- name: CPython 3.9
67-
runs-on: "3.9"
6866
- name: CPython 3.10
6967
runs-on: "3.10"
7068
- name: CPython 3.11

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ with MSS() as sct:
2020

2121
An ultra-fast cross-platform multiple screenshots module in pure python using ctypes.
2222

23-
- **Python 3.9+**, PEP8 compliant, no dependency, thread-safe;
23+
- **Python 3.10+**, PEP8 compliant, no dependency, thread-safe;
2424
- very basic, it will grab one screenshot by monitor or a screenshot of all monitors and save it to a PNG file;
2525
- but you can use PIL and benefit from all its formats (or add yours directly);
2626
- integrate well with Numpy and OpenCV;

docs/source/examples/pil_pixels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
img = Image.new("RGB", sct_img.size)
1717

1818
# Best solution: create a list(tuple(R, G, B), ...) for putdata()
19-
pixels = zip(sct_img.raw[2::4], sct_img.raw[1::4], sct_img.raw[::4])
19+
pixels = zip(sct_img.raw[2::4], sct_img.raw[1::4], sct_img.raw[::4], strict=False)
2020
img.putdata(list(pixels))
2121

2222
# But you can set individual pixels too (slower)

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Welcome to Python MSS's documentation!
2020
2121
An ultra fast cross-platform multiple screenshots module in pure python using ctypes.
2222

23-
- **Python 3.9+**, :pep:`8` compliant, no dependency, thread-safe;
23+
- **Python 3.10+**, :pep:`8` compliant, no dependency, thread-safe;
2424
- very basic, it will grab one screenshot by monitor or a screenshot of all monitors and save it to a PNG file;
2525
- but you can use PIL and benefit from all its formats (or add yours directly);
2626
- integrate well with Numpy and OpenCV;

docs/source/release-history/unreleased.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,12 @@ This is **version 11.0.0 of Python-MSS**, the ultra-fast cross-platform multiple
44

55
Release date: 2026-xx-x
66

7+
---
8+
9+
## Highlights
10+
11+
### Python 3.9 EOL
12+
13+
Python 3.9 reached [end-of-life](https://devguide.python.org/developer-workflow/development-cycle/index.html#end-of-life-branches) on [October 31, 2025](https://devguide.python.org/versions/). It is no longer receiving any updates, even security updates.
14+
15+
The MSS project has chosen to end support for Python 3.9, in order to focus our resources on current versions of Python.

docs/source/support.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Support
55
Feel free to try MSS on a system we had not tested, and let us know by creating an `issue <https://github.com/BoboTiG/python-mss/issues>`_.
66

77
- OS: GNU/Linux, macOS, and Windows
8-
- Python: 3.9 and newer
8+
- Python: 3.10 and newer
99

1010

1111
Future
@@ -35,3 +35,4 @@ Abandoned
3535
- Python 3.6 (2022-10-27)
3636
- Python 3.7 (2023-04-09)
3737
- Python 3.8 (2024-11-14)
38+
- Python 3.9 (2026-xx-xx)

pyproject.toml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
66
name = "mss"
77
description = "An ultra fast cross-platform multiple screenshots module in pure python using ctypes."
88
readme = "README.md"
9-
requires-python = ">= 3.9"
9+
requires-python = ">= 3.10"
1010
authors = [
1111
{ name = "Mickaël Schoentgen", email="contact@tiger-222.fr" },
1212
]
@@ -31,7 +31,6 @@ classifiers = [
3131
"Programming Language :: Python",
3232
"Programming Language :: Python :: 3",
3333
"Programming Language :: Python :: 3 :: Only",
34-
"Programming Language :: Python :: 3.9",
3534
"Programming Language :: Python :: 3.10",
3635
"Programming Language :: Python :: 3.11",
3736
"Programming Language :: Python :: 3.12",
@@ -87,11 +86,9 @@ docs = [
8786
tests = [
8887
"numpy==2.4.3 ; sys_platform == 'linux' and python_version == '3.13'",
8988
"pillow==12.1.1 ; sys_platform == 'linux' and python_version == '3.13'",
90-
"pytest==9.0.2 ; python_version > '3.9'",
91-
"pytest==8.4.2 ; python_version == '3.9'",
89+
"pytest==9.0.2",
9290
"pytest-cov==7.1.0",
93-
"pytest-rerunfailures==16.1 ; python_version > '3.9'",
94-
"pytest-rerunfailures==16.0.1 ; python_version == '3.9'",
91+
"pytest-rerunfailures==16.1",
9592
"pyvirtualdisplay==3.0 ; sys_platform == 'linux'",
9693
]
9794

@@ -163,7 +160,7 @@ exclude = [
163160
]
164161
line-length = 120
165162
indent-width = 4
166-
target-version = "py39"
163+
target-version = "py310"
167164

168165
[tool.ruff.format]
169166
quote-style = "double"

src/mss/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
Pixels = list[tuple[Pixel, ...]]
1414

1515
if TYPE_CHECKING:
16-
from typing import Callable
16+
from collections.abc import Callable
1717

1818
CFunctions = dict[str, tuple[str, list[Any], Any]]
1919
CFunctionsErrChecked = dict[str, tuple[str, list[Any], Any, Callable | None]]

src/mss/screenshot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ def pixels(self) -> Pixels:
9494
Each pixel is a tuple of (R, G, B).
9595
"""
9696
if not self.__pixels:
97-
rgb_tuples: Iterator[Pixel] = zip(self.raw[2::4], self.raw[1::4], self.raw[::4])
98-
self.__pixels = list(zip(*[iter(rgb_tuples)] * self.width))
97+
rgb_tuples: Iterator[Pixel] = zip(self.raw[2::4], self.raw[1::4], self.raw[::4], strict=False)
98+
self.__pixels = list(zip(*[iter(rgb_tuples)] * self.width, strict=False))
9999

100100
return self.__pixels
101101

src/mss/windows/gdi.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
from mss.exception import ScreenShotError
3535

3636
if TYPE_CHECKING:
37-
from typing import Any, Callable
37+
from collections.abc import Callable
38+
from typing import Any
3839

3940
from mss.models import CFunctionsErrChecked, Monitor, Monitors
4041

0 commit comments

Comments
 (0)