Skip to content

Commit

Permalink
Drop support for python 3.8, declare support for 3.13 (#301)
Browse files Browse the repository at this point in the history
* Drop support for python 3.8, declare support for 3.13

* run `pyupgrade --py39-plus` on the codebase

* Remove unused import
  • Loading branch information
youtux authored Oct 16, 2024
1 parent e3235ae commit cefb74e
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 25 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ jobs:
# - windows-latest
- macos-13
python-version:
- '3.13'
- '3.12'
- '3.11'
- '3.10'
- '3.9'
- '3.8'
- 'pypy-3.8'
- 'pypy-3.9'

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt
- [.NET] Update System.Text.Json to 6.0.10

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


Expand Down
6 changes: 3 additions & 3 deletions python/gherkin/ast_builder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import TypedDict, cast, TypeVar, Union, List
from typing import TypedDict, cast, TypeVar, Union

from .ast_node import AstNode
from .errors import AstBuilderException
Expand Down Expand Up @@ -140,7 +140,7 @@ def get_description(node: AstNode) -> str:

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

def transform_node(
self, node: AstNode
Expand Down Expand Up @@ -247,7 +247,7 @@ def transform_node(
examples_line = examples_node.get_token("ExamplesLine")
description = self.get_description(examples_node)
examples_table_rows = cast(
List[TableRow], examples_node.get_single("ExamplesTable")
list[TableRow], examples_node.get_single("ExamplesTable")
)
table_header = examples_table_rows[0] if examples_table_rows else None
table_body = examples_table_rows[1:] if examples_table_rows else []
Expand Down
24 changes: 12 additions & 12 deletions python/gherkin/dialect.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import os
import json
from typing import TypedDict, List
from typing import TypedDict

from typing_extensions import Self

Expand All @@ -14,17 +14,17 @@
DialectSpec = TypedDict(
"DialectSpec",
{
"and": List[str],
"background": List[str],
"but": List[str],
"examples": List[str],
"feature": List[str],
"given": List[str],
"rule": List[str],
"scenario": List[str],
"scenarioOutline": List[str],
"then": List[str],
"when": List[str],
"and": list[str],
"background": list[str],
"but": list[str],
"examples": list[str],
"feature": list[str],
"given": list[str],
"rule": list[str],
"scenario": list[str],
"scenarioOutline": list[str],
"then": list[str],
"when": list[str],
},
)

Expand Down
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ packages = ["gherkin"]
force-exclude = """(
(python/)?gherkin/parser.py
)"""
target-version = ["py38", "py39", "py310", "py311", "py312", "py313"]
target-version = ["py39", "py310", "py311", "py312", "py313"]
3 changes: 0 additions & 3 deletions python/test/count_symbols_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# coding=utf-8


def test_count_length_of_astral_point_symbols_correctly():
string = "\U0001f63b"
assert 1 == len(string)
Expand Down
1 change: 0 additions & 1 deletion python/test/gherkin_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding=utf-8
from gherkin.token_scanner import TokenScanner
from gherkin.token_matcher import TokenMatcher
from gherkin.parser import Parser
Expand Down
1 change: 0 additions & 1 deletion python/test/pickles_test/compiler_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding=utf-8
import json
import textwrap

Expand Down
2 changes: 1 addition & 1 deletion python/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# ============================================================================

[tox]
envlist = py312, py311, py310, py39, py38
envlist = py313, py312, py311, py310, py39

# -----------------------------------------------------------------------------
# TEST ENVIRONMENTS:
Expand Down

0 comments on commit cefb74e

Please sign in to comment.