Skip to content

Commit 327b93d

Browse files
authored
feat: drop Python 3.9 support (#1688)
1 parent 1ea6b94 commit 327b93d

11 files changed

Lines changed: 22 additions & 77 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,12 @@ jobs:
5151
fail-fast: false
5252
matrix:
5353
python-version:
54-
- "3.9"
5554
- "3.10"
5655
- "3.11"
5756
- "3.12"
5857
- "3.13"
5958
- "3.14"
6059
- "3.14t"
61-
- "pypy-3.9"
6260
- "pypy-3.10"
6361
os:
6462
- ubuntu-latest
@@ -72,12 +70,8 @@ jobs:
7270
extension: use_cython
7371
- os: windows-latest
7472
extension: use_cython
75-
- os: windows-latest
76-
python-version: "pypy-3.9"
7773
- os: windows-latest
7874
python-version: "pypy-3.10"
79-
- os: macos-latest
80-
python-version: "pypy-3.9"
8175
- os: macos-latest
8276
python-version: "pypy-3.10"
8377
runs-on: ${{ matrix.os }}

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ repos:
3838
rev: v3.21.2
3939
hooks:
4040
- id: pyupgrade
41-
args: [--py39-plus]
41+
args: [--py310-plus]
4242
- repo: https://github.com/astral-sh/ruff-pre-commit
4343
rev: v0.15.12
4444
hooks:

CLAUDE.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ path. The authoritative list of cythonized modules lives in
7070
and `zeroconf/asyncio.py` re-export.
7171

7272
- **Line length**: 110 (ruff `line-length = 110`).
73-
`requires-python = ">=3.9"`, `target-version = "py39"` for
74-
ruff; pyupgrade runs `--py39-plus`.
73+
`requires-python = ">=3.10"`, `target-version = "py310"` for
74+
ruff; pyupgrade runs `--py310-plus`.
7575

7676
- **Imports**: ruff/isort sorted, `profile = "black"`,
7777
`known_first_party = ["zeroconf", "tests"]`. Prefer
7878
`from __future__ import annotations` so modern type syntax
79-
works on 3.9.
79+
works on 3.10.
8080

8181
- **Generated `.c` files are not lint-targets.** `*.c` files
8282
next to each cythonized module are Cython output — never hand-
@@ -124,8 +124,8 @@ CodSpeed benchmarks live under `tests/benchmarks/` and run in CI
124124
through `CodSpeedHQ/action`. Ad-hoc microbenchmarks for manual
125125
profiling live under `bench/` — those don't run in CI.
126126

127-
The CI matrix includes CPython 3.9 – 3.14, the free-threaded
128-
3.14t build, and PyPy 3.9 / 3.10. Don't add anything that breaks
127+
The CI matrix includes CPython 3.10 – 3.14, the free-threaded
128+
3.14t build, and PyPy 3.10. Don't add anything that breaks
129129
on the free-threaded build (no module-level mutable globals
130130
mutated from multiple threads without locks; no
131131
`PyDict_Next`-style escape hatches in Cython).

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ Compared to some other Zeroconf/Bonjour/Avahi Python packages, python-zeroconf:
5353
Python compatibility
5454
--------------------
5555

56-
* CPython 3.9+
57-
* PyPy 3.9+
56+
* CPython 3.10+
57+
* PyPy 3.10+
5858

5959
Versioning
6060
----------

poetry.lock

Lines changed: 3 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ authors = [
1414
{ name = "Jakub Stasiak" },
1515
{ name = "J. Nick Koston" },
1616
]
17-
requires-python = ">=3.9"
17+
requires-python = ">=3.10"
1818

1919
[project.urls]
2020
"Repository" = "https://github.com/python-zeroconf/python-zeroconf"
@@ -80,7 +80,7 @@ match = "(?!(master|release-0.x)$)"
8080
prerelease = true
8181

8282
[tool.poetry.dependencies]
83-
python = "^3.9"
83+
python = "^3.10"
8484
ifaddr = ">=0.1.7"
8585

8686
[tool.poetry.group.dev.dependencies]
@@ -97,7 +97,7 @@ sphinx = "^7.4.7 || ^8.1.3"
9797
sphinx-rtd-theme = "^3.1.0"
9898

9999
[tool.ruff]
100-
target-version = "py39"
100+
target-version = "py310"
101101
line-length = 110
102102

103103
[tool.ruff.lint]

src/zeroconf/_cache.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
from collections.abc import Iterable
2626
from heapq import heapify, heappop, heappush
27-
from typing import Union, cast
27+
from typing import cast
2828

2929
from ._dns import (
3030
DNSAddress,
@@ -40,7 +40,7 @@
4040
from .const import _ONE_SECOND, _TYPE_PTR
4141

4242
_UNIQUE_RECORD_TYPES = (DNSAddress, DNSHinfo, DNSPointer, DNSText, DNSService)
43-
_UniqueRecordsType = Union[DNSAddress, DNSHinfo, DNSPointer, DNSText, DNSService]
43+
_UniqueRecordsType = DNSAddress | DNSHinfo | DNSPointer | DNSText | DNSService
4444
_DNSRecordCacheType = dict[str, dict[DNSRecord, DNSRecord]]
4545
_DNSRecord = DNSRecord
4646
_str = str

src/zeroconf/_services/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
from __future__ import annotations
2424

2525
import enum
26-
from typing import TYPE_CHECKING, Any, Callable
26+
from collections.abc import Callable
27+
from typing import TYPE_CHECKING, Any
2728

2829
if TYPE_CHECKING:
2930
from .._core import Zeroconf

src/zeroconf/_services/browser.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,12 @@
3030
import threading
3131
import time
3232
import warnings
33-
from collections.abc import Iterable
33+
from collections.abc import Callable, Iterable
3434
from functools import partial
3535
from types import TracebackType # used in type hints
3636
from typing import (
3737
TYPE_CHECKING,
3838
Any,
39-
Callable,
4039
cast,
4140
)
4241

src/zeroconf/_utils/net.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import sys
3131
import warnings
3232
from collections.abc import Iterable, Sequence
33-
from typing import Any, Union, cast
33+
from typing import Any, cast
3434

3535
import ifaddr
3636

@@ -44,7 +44,7 @@ class InterfaceChoice(enum.Enum):
4444
All = 2
4545

4646

47-
InterfacesType = Union[Sequence[Union[str, int, tuple[tuple[str, int, int], int]]], InterfaceChoice]
47+
InterfacesType = Sequence[str | int | tuple[tuple[str, int, int], int]] | InterfaceChoice
4848

4949

5050
@enum.unique

0 commit comments

Comments
 (0)