Skip to content

Commit b938e70

Browse files
Merge pull request #12875 from Pierre-Sassoulas/drop-python3.8
Drop python 3.8 support
2 parents acf1303 + 10c0c62 commit b938e70

Some content is hidden

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

77 files changed

+283
-330
lines changed

Diff for: .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: |

Diff for: .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
),

Diff for: .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:

Diff for: 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

Diff for: 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

Diff for: 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).

Diff for: 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+

Diff for: pyproject.toml

+5-7
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",
@@ -84,11 +83,11 @@ scripts.pytest = "pytest:console_main"
8483
write_to = "src/_pytest/_version.py"
8584

8685
[tool.black]
87-
target-version = [
88-
'py38',
89-
]
86+
# See https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#t-target-version
87+
target-version = [ "py39", "py310", "py311", "py312", "py313" ]
9088

9189
[tool.ruff]
90+
target-version = "py39"
9291
line-length = 88
9392
src = [
9493
"src",
@@ -230,7 +229,6 @@ disable = [
230229
"deprecated-argument",
231230
"deprecated-attribute",
232231
"deprecated-class",
233-
"deprecated-typing-alias",
234232
"disallowed-name", # foo / bar are used often in tests
235233
"duplicate-code",
236234
"else-if-used", # not activated by default, PLR5501 disabled in ruff
@@ -508,7 +506,7 @@ files = [
508506
mypy_path = [
509507
"src",
510508
]
511-
python_version = "3.8"
509+
python_version = "3.9"
512510
check_untyped_defs = true
513511
disallow_any_generics = true
514512
disallow_untyped_defs = true

Diff for: 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

Diff for: 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

0 commit comments

Comments
 (0)