Skip to content

Commit cefb74e

Browse files
authored
Drop support for python 3.8, declare support for 3.13 (#301)
* Drop support for python 3.8, declare support for 3.13 * run `pyupgrade --py39-plus` on the codebase * Remove unused import
1 parent e3235ae commit cefb74e

File tree

9 files changed

+20
-25
lines changed

9 files changed

+20
-25
lines changed

.github/workflows/test-python.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ jobs:
3232
# - windows-latest
3333
- macos-13
3434
python-version:
35+
- '3.13'
3536
- '3.12'
3637
- '3.11'
3738
- '3.10'
3839
- '3.9'
39-
- '3.8'
40-
- 'pypy-3.8'
40+
- 'pypy-3.9'
4141

4242
steps:
4343
- uses: actions/checkout@v4

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt
2323
- [.NET] Update System.Text.Json to 6.0.10
2424

2525
### Removed
26-
- [Python] Drop compatibility for python 2. Supported python versions are 3.8, 3.9, 3.10, 3.12
26+
- [Python] Drop compatibility for python 2 and python 3.8. Supported python versions: 3.9, 3.10, 3.11, 3.12, 3.13
2727
- [Python] Removed installation of `gherkin` script. It was used for internal acceptance tests only.
2828

2929

python/gherkin/ast_builder.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import TypedDict, cast, TypeVar, Union, List
3+
from typing import TypedDict, cast, TypeVar, Union
44

55
from .ast_node import AstNode
66
from .errors import AstBuilderException
@@ -140,7 +140,7 @@ def get_description(node: AstNode) -> str:
140140

141141
@staticmethod
142142
def get_steps(node: AstNode) -> list[Step]:
143-
return cast(List[Step], node.get_items("Step"))
143+
return cast(list[Step], node.get_items("Step"))
144144

145145
def transform_node(
146146
self, node: AstNode
@@ -247,7 +247,7 @@ def transform_node(
247247
examples_line = examples_node.get_token("ExamplesLine")
248248
description = self.get_description(examples_node)
249249
examples_table_rows = cast(
250-
List[TableRow], examples_node.get_single("ExamplesTable")
250+
list[TableRow], examples_node.get_single("ExamplesTable")
251251
)
252252
table_header = examples_table_rows[0] if examples_table_rows else None
253253
table_body = examples_table_rows[1:] if examples_table_rows else []

python/gherkin/dialect.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import os
44
import json
5-
from typing import TypedDict, List
5+
from typing import TypedDict
66

77
from typing_extensions import Self
88

@@ -14,17 +14,17 @@
1414
DialectSpec = TypedDict(
1515
"DialectSpec",
1616
{
17-
"and": List[str],
18-
"background": List[str],
19-
"but": List[str],
20-
"examples": List[str],
21-
"feature": List[str],
22-
"given": List[str],
23-
"rule": List[str],
24-
"scenario": List[str],
25-
"scenarioOutline": List[str],
26-
"then": List[str],
27-
"when": List[str],
17+
"and": list[str],
18+
"background": list[str],
19+
"but": list[str],
20+
"examples": list[str],
21+
"feature": list[str],
22+
"given": list[str],
23+
"rule": list[str],
24+
"scenario": list[str],
25+
"scenarioOutline": list[str],
26+
"then": list[str],
27+
"when": list[str],
2828
},
2929
)
3030

python/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ packages = ["gherkin"]
4848
force-exclude = """(
4949
(python/)?gherkin/parser.py
5050
)"""
51-
target-version = ["py38", "py39", "py310", "py311", "py312", "py313"]
51+
target-version = ["py39", "py310", "py311", "py312", "py313"]

python/test/count_symbols_test.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# coding=utf-8
2-
3-
41
def test_count_length_of_astral_point_symbols_correctly():
52
string = "\U0001f63b"
63
assert 1 == len(string)

python/test/gherkin_test.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# coding=utf-8
21
from gherkin.token_scanner import TokenScanner
32
from gherkin.token_matcher import TokenMatcher
43
from gherkin.parser import Parser

python/test/pickles_test/compiler_test.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# coding=utf-8
21
import json
32
import textwrap
43

python/tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# ============================================================================
1414

1515
[tox]
16-
envlist = py312, py311, py310, py39, py38
16+
envlist = py313, py312, py311, py310, py39
1717

1818
# -----------------------------------------------------------------------------
1919
# TEST ENVIRONMENTS:

0 commit comments

Comments
 (0)