Skip to content

Commit 39c62b3

Browse files
authored
Drop EOL Python 3.8 support (#1162)
* Drop EOL Python 3.8 support * Run pyupgrade --py39-plus on all files * Revert using direct annotations in looponfail.py We need to use string annotations otherwise we get this error: ``` ValueError: ("the use of non-builtin globals isn't supported", ['execnet', 'Any']) ```
2 parents c3d7b77 + 31bee7c commit 39c62b3

File tree

19 files changed

+25
-29
lines changed

19 files changed

+25
-29
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ jobs:
3434
fail-fast: false
3535
matrix:
3636
tox_env:
37-
- "py38-pytestmin"
38-
- "py38-pytestlatest"
37+
- "py39-pytestmin"
3938
- "py39-pytestlatest"
4039
- "py310-pytestlatest"
4140
- "py311-pytestlatest"
@@ -47,10 +46,8 @@ jobs:
4746

4847
os: [ubuntu-latest, windows-latest]
4948
include:
50-
- tox_env: "py38-pytestmin"
51-
python: "3.8"
52-
- tox_env: "py38-pytestlatest"
53-
python: "3.8"
49+
- tox_env: "py39-pytestmin"
50+
python: "3.9"
5451
- tox_env: "py39-pytestlatest"
5552
python: "3.9"
5653
- tox_env: "py310-pytestlatest"

changelog/1162.removal.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Dropped support for EOL Python 3.8.

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,13 @@ classifiers = [
2525
"Programming Language :: Python",
2626
"Programming Language :: Python :: 3",
2727
"Programming Language :: Python :: 3 :: Only",
28-
"Programming Language :: Python :: 3.8",
2928
"Programming Language :: Python :: 3.9",
3029
"Programming Language :: Python :: 3.10",
3130
"Programming Language :: Python :: 3.11",
3231
"Programming Language :: Python :: 3.12",
3332
"Programming Language :: Python :: 3.13",
3433
]
35-
requires-python = ">=3.8"
34+
requires-python = ">=3.9"
3635
dependencies = [
3736
"execnet>=2.1",
3837
"pytest>=7.0.0",

src/xdist/_path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
from collections.abc import Iterator
12
from itertools import chain
23
import os
34
from pathlib import Path
45
from typing import Callable
5-
from typing import Iterator
66

77

88
def visit_path(

src/xdist/dsession.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
from __future__ import annotations
22

3+
from collections.abc import Sequence
34
from enum import auto
45
from enum import Enum
56
from queue import Empty
67
from queue import Queue
78
import sys
89
from typing import Any
9-
from typing import Sequence
1010
import warnings
1111

1212
import execnet

src/xdist/looponfail.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99

1010
from __future__ import annotations
1111

12+
from collections.abc import Sequence
1213
import os
1314
from pathlib import Path
1415
import sys
1516
import time
1617
from typing import Any
17-
from typing import Sequence
1818

1919
from _pytest._io import TerminalWriter
2020
import execnet

src/xdist/newhooks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
from __future__ import annotations
1616

17+
from collections.abc import Sequence
1718
import os
1819
from typing import Any
19-
from typing import Sequence
2020
from typing import TYPE_CHECKING
2121

2222
import execnet

src/xdist/remote.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
from __future__ import annotations
1010

1111
import collections
12+
from collections.abc import Generator
13+
from collections.abc import Iterable
14+
from collections.abc import Sequence
1215
import contextlib
1316
import enum
1417
import os
1518
import sys
1619
import time
1720
from typing import Any
18-
from typing import Generator
19-
from typing import Iterable
2021
from typing import Literal
21-
from typing import Sequence
2222
from typing import TypedDict
2323
from typing import Union
2424
import warnings
@@ -98,7 +98,7 @@ def replace(self, iterable: Iterable[Item]) -> None:
9898
self._items = collections.deque(iterable)
9999

100100
@contextlib.contextmanager
101-
def lock(self) -> Generator[collections.deque[Item], None, None]:
101+
def lock(self) -> Generator[collections.deque[Item]]:
102102
with self._lock:
103103
try:
104104
yield self._items

src/xdist/report.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

3+
from collections.abc import Sequence
34
from difflib import unified_diff
4-
from typing import Sequence
55

66

77
def report_collection_diff(

src/xdist/scheduler/each.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import Sequence
3+
from collections.abc import Sequence
44

55
import pytest
66

src/xdist/scheduler/load.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

3+
from collections.abc import Sequence
34
from itertools import cycle
4-
from typing import Sequence
55

66
import pytest
77

src/xdist/scheduler/loadscope.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from __future__ import annotations
22

33
from collections import OrderedDict
4+
from collections.abc import Sequence
45
from typing import NoReturn
5-
from typing import Sequence
66

77
import pytest
88

src/xdist/scheduler/protocol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

3+
from collections.abc import Sequence
34
from typing import Protocol
4-
from typing import Sequence
55

66
from xdist.workermanage import WorkerController
77

src/xdist/scheduler/worksteal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

3+
from collections.abc import Sequence
34
from typing import NamedTuple
4-
from typing import Sequence
55

66
import pytest
77

src/xdist/workermanage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
from collections.abc import Sequence
34
import enum
45
import fnmatch
56
import os
@@ -9,7 +10,6 @@
910
from typing import Any
1011
from typing import Callable
1112
from typing import Literal
12-
from typing import Sequence
1313
from typing import Union
1414
import uuid
1515
import warnings

testing/conftest.py

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

3+
from collections.abc import Generator
34
import shutil
45
from typing import Callable
5-
from typing import Generator
66

77
import execnet
88
import pytest
@@ -12,7 +12,7 @@
1212

1313

1414
@pytest.fixture(autouse=True)
15-
def _divert_atexit(monkeypatch: pytest.MonkeyPatch) -> Generator[None, None, None]:
15+
def _divert_atexit(monkeypatch: pytest.MonkeyPatch) -> Generator[None]:
1616
import atexit
1717

1818
finalizers = []

testing/test_dsession.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from __future__ import annotations
22

3+
from collections.abc import Sequence
34
from typing import Any
45
from typing import cast
5-
from typing import Sequence
66
from typing import TYPE_CHECKING
77

88
import execnet

testing/test_remote.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from typing import Any
88
from typing import Callable
99
from typing import cast
10-
from typing import Dict
1110
from typing import Union
1211
import uuid
1312

@@ -90,7 +89,7 @@ def worker(request: pytest.FixtureRequest, pytester: pytest.Pytester) -> WorkerS
9089

9190
class TestWorkerInteractor:
9291
UnserializerReport = Callable[
93-
[Dict[str, Any]], Union[pytest.CollectReport, pytest.TestReport]
92+
[dict[str, Any]], Union[pytest.CollectReport, pytest.TestReport]
9493
]
9594

9695
@pytest.fixture

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tox]
22
envlist =
33
linting
4-
py{38,39,310,311,312,313}-pytestlatest
4+
py{39,310,311,312,313}-pytestlatest
55
py310-pytestmain
66
py310-psutil
77
py310-setproctitle

0 commit comments

Comments
 (0)