Skip to content

Commit 18de3a8

Browse files
authored
Merge pull request #719 from pytest-dev/py3.13
Drop python 3.8 compatibility
2 parents 9b9c39e + a41887d commit 18de3a8

File tree

11 files changed

+20
-19
lines changed

11 files changed

+20
-19
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ jobs:
1111
strategy:
1212
matrix:
1313
include:
14-
- python-version: "3.8"
15-
toxfactor: py3.8
16-
ignore-typecheck-outcome: false
17-
ignore-test-outcome: false
1814
- python-version: "3.9"
1915
toxfactor: py3.9
2016
ignore-typecheck-outcome: false
@@ -31,7 +27,7 @@ jobs:
3127
toxfactor: py3.12
3228
ignore-typecheck-outcome: false
3329
ignore-test-outcome: false
34-
- python-version: "3.13-dev"
30+
- python-version: "3.13"
3531
toxfactor: py3.13
3632
ignore-typecheck-outcome: false
3733
ignore-test-outcome: false

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ repos:
2222
rev: v3.18.0
2323
hooks:
2424
- id: pyupgrade
25-
args: ["--py38-plus"]
25+
args: ["--py39-plus"]
2626
# TODO: Enable mypy checker when the checks succeed
2727
#- repo: https://github.com/pre-commit/mirrors-mypy
2828
# rev: v0.931

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Changelog
33

44
Unreleased
55
----------
6+
- Dropped support for python 3.8. Supported python versions: 3.9, 3.10, 3.11, 3.12, 3.13.
67

78
8.0.0b2
89
----------

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ classifiers = [
2020
"Topic :: Software Development :: Libraries",
2121
"Topic :: Utilities",
2222
"Programming Language :: Python :: 3",
23-
"Programming Language :: Python :: 3.8",
2423
"Programming Language :: Python :: 3.9",
2524
"Programming Language :: Python :: 3.10",
2625
"Programming Language :: Python :: 3.11",
@@ -58,7 +57,7 @@ build-backend = "poetry.core.masonry.api"
5857

5958
[tool.black]
6059
line-length = 120
61-
target-version = ["py38", "py39", "py310", "py311", "py312"]
60+
target-version = ["py39", "py310", "py311", "py312"]
6261

6362
[tool.isort]
6463
profile = "black"
@@ -90,7 +89,7 @@ source = [
9089

9190

9291
[tool.mypy]
93-
python_version = "3.8"
92+
python_version = "3.9"
9493
warn_return_any = true
9594
warn_unused_configs = true
9695
files = "src/pytest_bdd/**/*.py"

src/pytest_bdd/generation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
from .types import STEP_TYPES
1717

1818
if TYPE_CHECKING:
19-
from typing import Any, Sequence
19+
from collections.abc import Sequence
20+
from typing import Any
2021

2122
from _pytest.config import Config
2223
from _pytest.config.argparsing import Parser

src/pytest_bdd/parser.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
import re
55
import textwrap
66
from collections import OrderedDict
7+
from collections.abc import Iterable, Mapping, Sequence
78
from dataclasses import dataclass, field
8-
from typing import Any, Dict, Iterable, List, Mapping, Optional, Sequence
9+
from typing import Any
910

1011
from .exceptions import StepError
1112
from .gherkin_parser import Background as GherkinBackground
12-
from .gherkin_parser import DataTable, ExamplesTable
13+
from .gherkin_parser import DataTable
1314
from .gherkin_parser import Feature as GherkinFeature
1415
from .gherkin_parser import GherkinDocument
1516
from .gherkin_parser import Scenario as GherkinScenario

src/pytest_bdd/parsers.py

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

55
import abc
66
import re as base_re
7-
from typing import Any, Dict, TypeVar, cast, overload
7+
from typing import Any, TypeVar, cast, overload
88

99
import parse as base_parse
1010
from parse_type import cfparse as base_cfparse
@@ -66,7 +66,7 @@ def parse_arguments(self, name: str) -> dict[str, Any]:
6666
6767
:return: `dict` of step arguments
6868
"""
69-
return cast(Dict[str, Any], self.parser.parse(name).named)
69+
return cast(dict[str, Any], self.parser.parse(name).named)
7070

7171
def is_matching(self, name: str) -> bool:
7272
"""Match given name with the step name."""

src/pytest_bdd/plugin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
from __future__ import annotations
44

5-
from typing import TYPE_CHECKING, Any, Callable, Generator, TypeVar, cast
5+
from collections.abc import Generator
6+
from typing import TYPE_CHECKING, Any, Callable, TypeVar, cast
67

78
import pytest
89
from typing_extensions import ParamSpec

src/pytest_bdd/scenario.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
import logging
1818
import os
1919
import re
20-
from typing import TYPE_CHECKING, Any, Callable, Iterable, Iterator, List, TypeVar, cast
20+
from collections.abc import Iterable, Iterator
21+
from typing import TYPE_CHECKING, Any, Callable, TypeVar, cast
2122

2223
import pytest
2324
from _pytest.fixtures import FixtureDef, FixtureManager, FixtureRequest, call_fixture_func
@@ -62,7 +63,7 @@ def find_fixturedefs_for_step(step: Step, fixturemanager: FixtureManager, node:
6263
if not match:
6364
continue
6465

65-
fixturedefs = cast(List[FixtureDef[Any]], getfixturedefs(fixturemanager, fixturename, node) or [])
66+
fixturedefs = cast(list[FixtureDef[Any]], getfixturedefs(fixturemanager, fixturename, node) or [])
6667
if fixturedef not in fixturedefs:
6768
continue
6869

src/pytest_bdd/steps.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ def _(article):
3838
from __future__ import annotations
3939

4040
import enum
41+
from collections.abc import Iterable
4142
from dataclasses import dataclass, field
4243
from itertools import count
43-
from typing import Any, Callable, Iterable, Literal, TypeVar
44+
from typing import Any, Callable, Literal, TypeVar
4445

4546
import pytest
4647
from typing_extensions import ParamSpec

0 commit comments

Comments
 (0)