Skip to content

Commit 431be57

Browse files
authored
Merge pull request #556 from nicoddemus/drop-py38
Drop Python 3.8 support
2 parents 3d2b886 + b05954e commit 431be57

15 files changed

+44
-62
lines changed

.github/workflows/main.yml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
name: [
22-
"windows-py38",
22+
"windows-py39",
2323
"windows-py313",
2424
"windows-pypy3",
2525

26-
"ubuntu-py38-pytestmain",
27-
"ubuntu-py38",
26+
"ubuntu-py39-pytestmain",
2827
"ubuntu-py39",
2928
"ubuntu-py310",
3029
"ubuntu-py311",
@@ -35,10 +34,10 @@ jobs:
3534
]
3635

3736
include:
38-
- name: "windows-py38"
39-
python: "3.8"
37+
- name: "windows-py39"
38+
python: "3.9"
4039
os: windows-latest
41-
tox_env: "py38"
40+
tox_env: "py39"
4241
- name: "windows-py313"
4342
python: "3.13"
4443
os: windows-latest
@@ -47,15 +46,10 @@ jobs:
4746
python: "pypy3.9"
4847
os: windows-latest
4948
tox_env: "pypy3"
50-
- name: "ubuntu-py38"
51-
python: "3.8"
52-
os: ubuntu-latest
53-
tox_env: "py38"
54-
use_coverage: true
55-
- name: "ubuntu-py38-pytestmain"
56-
python: "3.8"
49+
- name: "ubuntu-py39-pytestmain"
50+
python: "3.9"
5751
os: ubuntu-latest
58-
tox_env: "py38-pytestmain"
52+
tox_env: "py39-pytestmain"
5953
use_coverage: true
6054
- name: "ubuntu-py39"
6155
python: "3.9"
@@ -87,7 +81,7 @@ jobs:
8781
tox_env: "pypy3"
8882
use_coverage: true
8983
- name: "ubuntu-benchmark"
90-
python: "3.8"
84+
python: "3.9"
9185
os: ubuntu-latest
9286
tox_env: "benchmark"
9387

@@ -136,7 +130,7 @@ jobs:
136130

137131
- uses: actions/setup-python@v5
138132
with:
139-
python-version: "3.11"
133+
python-version: "3.x"
140134

141135
- name: Install dependencies
142136
run: |

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ repos:
2828
rev: v3.19.0
2929
hooks:
3030
- id: pyupgrade
31-
args: [--py38-plus]
31+
args: [--py39-plus]
3232
- repo: https://github.com/asottile/blacken-docs
3333
rev: 1.19.1
3434
hooks:

changelog/556.removal.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Python 3.8 is no longer supported.

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ classifiers = [
2424
"Programming Language :: Python :: Implementation :: PyPy",
2525
"Programming Language :: Python :: 3",
2626
"Programming Language :: Python :: 3 :: Only",
27-
"Programming Language :: Python :: 3.8",
2827
"Programming Language :: Python :: 3.9",
2928
"Programming Language :: Python :: 3.10",
3029
"Programming Language :: Python :: 3.11",
@@ -33,7 +32,7 @@ classifiers = [
3332
]
3433
description = "plugin and hook calling mechanisms for python"
3534
readme = {file = "README.rst", content-type = "text/x-rst"}
36-
requires-python = ">=3.8"
35+
requires-python = ">=3.9"
3736

3837
dynamic = ["version"]
3938
[project.optional-dependencies]

src/pluggy/_callers.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44

55
from __future__ import annotations
66

7+
from collections.abc import Generator
8+
from collections.abc import Mapping
9+
from collections.abc import Sequence
710
from typing import cast
8-
from typing import Generator
9-
from typing import Mapping
1011
from typing import NoReturn
11-
from typing import Sequence
12-
from typing import Tuple
1312
from typing import Union
1413
import warnings
1514

@@ -22,7 +21,7 @@
2221
# Need to distinguish between old- and new-style hook wrappers.
2322
# Wrapping with a tuple is the fastest type-safe way I found to do it.
2423
Teardown = Union[
25-
Tuple[Generator[None, Result[object], None], HookImpl],
24+
tuple[Generator[None, Result[object], None], HookImpl],
2625
Generator[None, object, object],
2726
]
2827

src/pluggy/_hooks.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,19 @@
44

55
from __future__ import annotations
66

7+
from collections.abc import Generator
8+
from collections.abc import Mapping
9+
from collections.abc import Sequence
10+
from collections.abc import Set
711
import inspect
812
import sys
913
from types import ModuleType
10-
from typing import AbstractSet
1114
from typing import Any
1215
from typing import Callable
1316
from typing import Final
1417
from typing import final
15-
from typing import Generator
16-
from typing import List
17-
from typing import Mapping
1818
from typing import Optional
1919
from typing import overload
20-
from typing import Sequence
21-
from typing import Tuple
2220
from typing import TYPE_CHECKING
2321
from typing import TypedDict
2422
from typing import TypeVar
@@ -34,7 +32,7 @@
3432
_Plugin = object
3533
_HookExec = Callable[
3634
[str, Sequence["HookImpl"], Mapping[str, object], bool],
37-
Union[object, List[object]],
35+
Union[object, list[object]],
3836
]
3937
_HookImplFunction = Callable[..., Union[_T, Generator[None, Result[_T], None]]]
4038

@@ -376,7 +374,7 @@ def __getattr__(self, name: str) -> HookCaller: ...
376374
_HookRelay = HookRelay
377375

378376

379-
_CallHistory = List[Tuple[Mapping[str, object], Optional[Callable[[Any], None]]]]
377+
_CallHistory = list[tuple[Mapping[str, object], Optional[Callable[[Any], None]]]]
380378

381379

382380
class HookCaller:
@@ -608,7 +606,7 @@ class _SubsetHookCaller(HookCaller):
608606
"_remove_plugins",
609607
)
610608

611-
def __init__(self, orig: HookCaller, remove_plugins: AbstractSet[_Plugin]) -> None:
609+
def __init__(self, orig: HookCaller, remove_plugins: Set[_Plugin]) -> None:
612610
self._orig = orig
613611
self._remove_plugins = remove_plugins
614612
self.name = orig.name # type: ignore[misc]

src/pluggy/_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
from __future__ import annotations
22

3+
from collections.abc import Iterable
4+
from collections.abc import Mapping
5+
from collections.abc import Sequence
36
import inspect
47
import types
58
from typing import Any
69
from typing import Callable
710
from typing import cast
811
from typing import Final
9-
from typing import Iterable
10-
from typing import Mapping
11-
from typing import Sequence
1212
from typing import TYPE_CHECKING
1313
import warnings
1414

src/pluggy/_result.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@
1010
from typing import final
1111
from typing import Generic
1212
from typing import Optional
13-
from typing import Tuple
14-
from typing import Type
1513
from typing import TypeVar
1614

1715

18-
_ExcInfo = Tuple[Type[BaseException], BaseException, Optional[TracebackType]]
16+
_ExcInfo = tuple[type[BaseException], BaseException, Optional[TracebackType]]
1917
ResultType = TypeVar("ResultType")
2018

2119

src/pluggy/_tracing.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44

55
from __future__ import annotations
66

7+
from collections.abc import Sequence
78
from typing import Any
89
from typing import Callable
9-
from typing import Sequence
10-
from typing import Tuple
1110

1211

1312
_Writer = Callable[[str], object]
14-
_Processor = Callable[[Tuple[str, ...], Tuple[Any, ...]], object]
13+
_Processor = Callable[[tuple[str, ...], tuple[Any, ...]], object]
1514

1615

1716
class TagTracer:

testing/test_hookcaller.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
from collections.abc import Generator
2+
from collections.abc import Sequence
13
from typing import Callable
2-
from typing import Generator
3-
from typing import List
4-
from typing import Sequence
54
from typing import TypeVar
65

76
import pytest
@@ -63,7 +62,7 @@ def addmeth(hc: HookCaller) -> AddMeth:
6362
return AddMeth(hc)
6463

6564

66-
def funcs(hookmethods: Sequence[HookImpl]) -> List[Callable[..., object]]:
65+
def funcs(hookmethods: Sequence[HookImpl]) -> list[Callable[..., object]]:
6766
return [hookmethod.function for hookmethod in hookmethods]
6867

6968

0 commit comments

Comments
 (0)