Skip to content

Commit a4cb74e

Browse files
Upgrade doc and CI after dropping python 3.8
1 parent acf1303 commit a4cb74e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+230
-226
lines changed

.github/workflows/prepare-release-pr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Set up Python
3535
uses: actions/setup-python@v5
3636
with:
37-
python-version: "3.8"
37+
python-version: "3.x"
3838

3939
- name: Install dependencies
4040
run: |

.github/workflows/test.yml

+59-44
Original file line numberDiff line numberDiff line change
@@ -54,25 +54,24 @@ jobs:
5454
fail-fast: false
5555
matrix:
5656
name: [
57-
"windows-py38",
58-
"windows-py38-pluggy",
59-
"windows-py39",
57+
"windows-py39-unittestextras",
58+
"windows-py39-pluggy",
59+
"windows-py39-xdist",
6060
"windows-py310",
6161
"windows-py311",
6262
"windows-py312",
6363
"windows-py313",
6464

65-
"ubuntu-py38",
66-
"ubuntu-py38-pluggy",
67-
"ubuntu-py38-freeze",
68-
"ubuntu-py39",
69-
"ubuntu-py310",
65+
"ubuntu-py39-lsof-numpy-pexpect",
66+
"ubuntu-py39-pluggy",
67+
"ubuntu-py39-freeze",
68+
"ubuntu-py39-xdist",
69+
"ubuntu-py310-xdist",
7070
"ubuntu-py311",
7171
"ubuntu-py312",
72-
"ubuntu-py313",
73-
"ubuntu-pypy3",
72+
"ubuntu-py313-pexpect",
73+
"ubuntu-pypy3-xdist",
7474

75-
"macos-py38",
7675
"macos-py39",
7776
"macos-py310",
7877
"macos-py312",
@@ -83,106 +82,122 @@ jobs:
8382
]
8483

8584
include:
86-
- name: "windows-py38"
87-
python: "3.8"
85+
- name: "windows-py39-unittestextras"
86+
python: "3.9"
8887
os: windows-latest
89-
tox_env: "py38-unittestextras"
88+
tox_env: "py39-unittestextras"
9089
use_coverage: true
91-
- name: "windows-py38-pluggy"
92-
python: "3.8"
90+
91+
- name: "windows-py39-pluggy"
92+
python: "3.9"
9393
os: windows-latest
94-
tox_env: "py38-pluggymain-pylib-xdist"
95-
- name: "windows-py39"
94+
tox_env: "py39-pluggymain-pylib-xdist"
95+
96+
- name: "windows-py39-xdist"
9697
python: "3.9"
9798
os: windows-latest
9899
tox_env: "py39-xdist"
100+
99101
- name: "windows-py310"
100102
python: "3.10"
101103
os: windows-latest
102104
tox_env: "py310-xdist"
105+
103106
- name: "windows-py311"
104107
python: "3.11"
105108
os: windows-latest
106109
tox_env: "py311"
110+
107111
- name: "windows-py312"
108112
python: "3.12"
109113
os: windows-latest
110114
tox_env: "py312"
115+
111116
- name: "windows-py313"
112-
python: "3.13-dev"
117+
python: "3.13"
113118
os: windows-latest
114119
tox_env: "py313"
115120

116-
- name: "ubuntu-py38"
117-
python: "3.8"
121+
122+
- name: "ubuntu-py39-lsof-numpy-pexpect"
123+
python: "3.9"
118124
os: ubuntu-latest
119-
tox_env: "py38-lsof-numpy-pexpect"
120-
use_coverage: true
121-
- name: "ubuntu-py38-pluggy"
122-
python: "3.8"
125+
tox_env: "py39-lsof-numpy-pexpect"
126+
127+
- name: "ubuntu-py39-pluggy"
128+
python: "3.9"
123129
os: ubuntu-latest
124-
tox_env: "py38-pluggymain-pylib-xdist"
125-
- name: "ubuntu-py38-freeze"
126-
python: "3.8"
130+
tox_env: "py39-pluggymain-pylib-xdist"
131+
132+
- name: "ubuntu-py39-freeze"
133+
python: "3.9"
127134
os: ubuntu-latest
128-
tox_env: "py38-freeze"
129-
- name: "ubuntu-py39"
135+
tox_env: "py39-freeze"
136+
137+
- name: "ubuntu-py39-xdist"
130138
python: "3.9"
131139
os: ubuntu-latest
132140
tox_env: "py39-xdist"
133-
- name: "ubuntu-py310"
141+
142+
- name: "ubuntu-py310-xdist"
134143
python: "3.10"
135144
os: ubuntu-latest
136145
tox_env: "py310-xdist"
146+
137147
- name: "ubuntu-py311"
138148
python: "3.11"
139149
os: ubuntu-latest
140150
tox_env: "py311"
141151
use_coverage: true
152+
142153
- name: "ubuntu-py312"
143154
python: "3.12"
144155
os: ubuntu-latest
145156
tox_env: "py312"
146157
use_coverage: true
147-
- name: "ubuntu-py313"
148-
python: "3.13-dev"
158+
159+
- name: "ubuntu-py313-pexpect"
160+
python: "3.13"
149161
os: ubuntu-latest
150162
tox_env: "py313-pexpect"
151163
use_coverage: true
152-
- name: "ubuntu-pypy3"
164+
165+
- name: "ubuntu-pypy3-xdist"
153166
python: "pypy-3.9"
154167
os: ubuntu-latest
155168
tox_env: "pypy3-xdist"
156169

157-
- name: "macos-py38"
158-
python: "3.8"
159-
os: macos-latest
160-
tox_env: "py38-xdist"
170+
161171
- name: "macos-py39"
162172
python: "3.9"
163173
os: macos-latest
164174
tox_env: "py39-xdist"
165175
use_coverage: true
176+
166177
- name: "macos-py310"
167178
python: "3.10"
168179
os: macos-latest
169180
tox_env: "py310-xdist"
181+
170182
- name: "macos-py312"
171183
python: "3.12"
172184
os: macos-latest
173185
tox_env: "py312-xdist"
186+
174187
- name: "macos-py313"
175-
python: "3.13-dev"
188+
python: "3.13"
176189
os: macos-latest
177190
tox_env: "py313-xdist"
178191

192+
179193
- name: "plugins"
180194
python: "3.12"
181195
os: ubuntu-latest
182196
tox_env: "plugins"
183197

198+
184199
- name: "doctesting"
185-
python: "3.8"
200+
python: "3.9"
186201
os: ubuntu-latest
187202
tox_env: "doctesting"
188203
use_coverage: true
@@ -192,12 +207,12 @@ jobs:
192207
contains(
193208
fromJSON(
194209
'[
195-
"windows-py38-pluggy",
210+
"windows-py39-pluggy",
196211
"windows-py313",
197-
"ubuntu-py38-pluggy",
198-
"ubuntu-py38-freeze",
212+
"ubuntu-py39-pluggy",
213+
"ubuntu-py39-freeze",
199214
"ubuntu-py313",
200-
"macos-py38",
215+
"macos-py39",
201216
"macos-py313"
202217
]'
203218
),

.pre-commit-config.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ repos:
5353
rev: v3.19.0
5454
hooks:
5555
- id: pyupgrade
56+
args:
57+
- "--py39-plus"
58+
# Manual because ruff does what pyupgrade does and the two are not out of sync
59+
# often enough to make launching pyupgrade everytime worth it
5660
stages: [manual]
5761
- repo: local
5862
hooks:

CONTRIBUTING.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ Here is a simple overview, with pytest-specific bits:
270270

271271
#. Run all the tests
272272

273-
You need to have Python 3.8 or later available in your system. Now
273+
You need to have Python 3.9 or later available in your system. Now
274274
running tests is as simple as issuing this command::
275275

276276
$ tox -e linting,py39

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Features
9797
- Can run `unittest <https://docs.pytest.org/en/stable/how-to/unittest.html>`_ (or trial)
9898
test suites out of the box
9999

100-
- Python 3.8+ or PyPy3
100+
- Python 3.9+ or PyPy3
101101

102102
- Rich plugin architecture, with over 1300+ `external plugins <https://docs.pytest.org/en/latest/reference/plugin_list.html>`_ and thriving community
103103

changelog/12874.breaking.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
We dropped support for Python 3.8 following its end of life (2024-10-07).

doc/en/backwards-compatibility.rst

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Released pytest versions support all Python versions that are actively maintaine
8383
============== ===================
8484
pytest version min. Python version
8585
============== ===================
86+
8.4+ 3.9+
8687
8.0+ 3.8+
8788
7.1+ 3.7+
8889
6.2 - 7.0 3.6+

pyproject.toml

+3-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ authors = [
2323
{ name = "Florian Bruhin" },
2424
{ name = "Others (See AUTHORS)" },
2525
]
26-
requires-python = ">=3.8"
26+
requires-python = ">=3.9"
2727
classifiers = [
2828
"Development Status :: 6 - Mature",
2929
"Intended Audience :: Developers",
@@ -33,7 +33,6 @@ classifiers = [
3333
"Operating System :: POSIX",
3434
"Operating System :: Unix",
3535
"Programming Language :: Python :: 3 :: Only",
36-
"Programming Language :: Python :: 3.8",
3736
"Programming Language :: Python :: 3.9",
3837
"Programming Language :: Python :: 3.10",
3938
"Programming Language :: Python :: 3.11",
@@ -85,7 +84,7 @@ write_to = "src/_pytest/_version.py"
8584

8685
[tool.black]
8786
target-version = [
88-
'py38',
87+
'py39',
8988
]
9089

9190
[tool.ruff]
@@ -508,7 +507,7 @@ files = [
508507
mypy_path = [
509508
"src",
510509
]
511-
python_version = "3.8"
510+
python_version = "3.9"
512511
check_untyped_defs = true
513512
disallow_any_generics = true
514513
disallow_untyped_defs = true

scripts/generate-gh-release-notes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111

1212
from __future__ import annotations
1313

14+
from collections.abc import Sequence
1415
from pathlib import Path
1516
import re
1617
import sys
17-
from typing import Sequence
1818

1919
import pypandoc
2020

scripts/update-plugin-list.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# mypy: disallow-untyped-defs
22
from __future__ import annotations
33

4+
from collections.abc import Iterable
5+
from collections.abc import Iterator
46
import datetime
57
import pathlib
68
import re
79
from textwrap import dedent
810
from textwrap import indent
911
from typing import Any
10-
from typing import Iterable
11-
from typing import Iterator
1212
from typing import TypedDict
1313

1414
import packaging.version

src/_pytest/_code/code.py

+6-9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
from __future__ import annotations
33

44
import ast
5+
from collections.abc import Iterable
6+
from collections.abc import Mapping
7+
from collections.abc import Sequence
58
import dataclasses
69
import inspect
710
from inspect import CO_VARARGS
@@ -10,6 +13,7 @@
1013
import os
1114
from pathlib import Path
1215
import re
16+
from re import Pattern
1317
import sys
1418
import traceback
1519
from traceback import format_exception_only
@@ -22,16 +26,9 @@
2226
from typing import Final
2327
from typing import final
2428
from typing import Generic
25-
from typing import Iterable
26-
from typing import List
2729
from typing import Literal
28-
from typing import Mapping
2930
from typing import overload
30-
from typing import Pattern
31-
from typing import Sequence
3231
from typing import SupportsIndex
33-
from typing import Tuple
34-
from typing import Type
3532
from typing import TypeVar
3633
from typing import Union
3734

@@ -56,7 +53,7 @@
5653

5754
TracebackStyle = Literal["long", "short", "line", "no", "native", "value", "auto"]
5855

59-
EXCEPTION_OR_MORE = Union[Type[BaseException], Tuple[Type[BaseException], ...]]
56+
EXCEPTION_OR_MORE = Union[type[BaseException], tuple[type[BaseException], ...]]
6057

6158

6259
class Code:
@@ -320,7 +317,7 @@ def name(self) -> str:
320317
return self.frame.code.raw.co_name
321318

322319

323-
class Traceback(List[TracebackEntry]):
320+
class Traceback(list[TracebackEntry]):
324321
"""Traceback objects encapsulate and offer higher level access to Traceback entries."""
325322

326323
def __init__(

src/_pytest/_code/source.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33

44
import ast
55
from bisect import bisect_right
6+
from collections.abc import Iterable
7+
from collections.abc import Iterator
68
import inspect
79
import textwrap
810
import tokenize
911
import types
10-
from typing import Iterable
11-
from typing import Iterator
1212
from typing import overload
1313
import warnings
1414

0 commit comments

Comments
 (0)