From 9311649229d2d568daeebeb0f6be7cfb0231e0a2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Jun 2026 21:06:31 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: c60c980e561ed3e73101667fe8365c609d19a438 → c59bba8fb259db0fec2bbb77ad8ba51ea7341b56](https://github.com/astral-sh/ruff-pre-commit/compare/c60c980e561ed3e73101667fe8365c609d19a438...c59bba8fb259db0fec2bbb77ad8ba51ea7341b56) - [github.com/python-poetry/poetry: a84cd0f1bedb5769ef6ef7389d8ee99b93b9ba4c → 811a12dae0fe81f199e3f1b88b8b8be9eed543c2](https://github.com/python-poetry/poetry/compare/a84cd0f1bedb5769ef6ef7389d8ee99b93b9ba4c...811a12dae0fe81f199e3f1b88b8b8be9eed543c2) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cd3058850..614394bd2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,13 +9,13 @@ repos: - id: check-yaml - id: check-added-large-files - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "c60c980e561ed3e73101667fe8365c609d19a438" # frozen: v0.15.9 + rev: "c59bba8fb259db0fec2bbb77ad8ba51ea7341b56" # frozen: v0.15.20 hooks: - id: ruff args: [ --fix ] - id: ruff-format - repo: https://github.com/python-poetry/poetry - rev: "a84cd0f1bedb5769ef6ef7389d8ee99b93b9ba4c" # frozen: 2.3.2 + rev: "811a12dae0fe81f199e3f1b88b8b8be9eed543c2" # frozen: 2.4.1 hooks: - id: poetry-check args: ["--lock"] From c4ba8241b553eeb1734caf5d7d911ca78b80244a Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Tue, 30 Jun 2026 22:43:13 +0200 Subject: [PATCH 2/2] fix: handle gherkin-official parsing changes and refresh poetry lock Two unrelated gherkin-official issues broke the CI matrix: 1. StopIteration crash on empty descriptions gherkin-official 31.0.0 and 32.0.0 crash with StopIteration when a description is made up only of empty lines (a comment directly after a keyword line). Fixed upstream in 32.0.1. The tox 'gherkin_official31' cell can only ever install the broken 31.0.0, so it is removed from the matrix and the dependency now excludes both broken releases. 2. Comments allowed inside descriptions (behaviour change in 31.0.0) Since cucumber/gherkin 93339df ('[All] Allow comment inside descriptions', PR cucumber/gherkin#334, first released in gherkin 31.0.0), a step placed directly under 'Feature:' is parsed as description text rather than a misplaced step, so the orphan-step error test no longer triggered a FeatureError. This is intended upstream behaviour and is unchanged through the latest gherkin (41.0.0), so the test feature is updated to place the step before 'Feature:', which raises the same FeatureError across gherkin 29 through 41. Also refreshes poetry.lock: only the content-hash changes, as the already-locked gherkin-official 37.0.0 still satisfies the new constraint. --- CHANGES.rst | 1 + poetry.lock | 2 +- pyproject.toml | 3 ++- tests/parser/test_errors.py | 2 +- tox.ini | 5 ++--- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 3b94132cb..442ba367c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -15,6 +15,7 @@ Added Changed +++++++ * Relaxed `gherkin-official` dependency requirement to `>=29.0.0` to allow for newer versions of the `gherkin-official` package. +* Excluded `gherkin-official` `31.0.0` and `32.0.0`, which crash with ``StopIteration`` when parsing empty descriptions (fixed upstream in `32.0.1`). Deprecated ++++++++++ diff --git a/poetry.lock b/poetry.lock index 6053fa5c6..246b5f316 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2637,4 +2637,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.1" python-versions = ">=3.9" -content-hash = "9f3e2dcb83935d30da4845c60716dc1f467d442ec64c6bdebfbb2ac15d511421" +content-hash = "4585eff389e4daeed9a31867ad3d46764f3cd22bfa684bc0f5ccafda6d5d9556" diff --git a/pyproject.toml b/pyproject.toml index ae7d285a3..dd62ed96d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,8 @@ dependencies = [ "pytest>=7.0.0", "typing-extensions", "packaging", - "gherkin-official>=29.0.0", + # 31.0.0 and 32.0.0 crash with StopIteration on empty descriptions (fixed in 32.0.1) + "gherkin-official>=29.0.0,!=31.0.0,!=32.0.0", ] [project.urls] diff --git a/tests/parser/test_errors.py b/tests/parser/test_errors.py index 5c616388a..1706868e9 100644 --- a/tests/parser/test_errors.py +++ b/tests/parser/test_errors.py @@ -40,10 +40,10 @@ def test_step_outside_scenario_or_background_error(pytester): features.joinpath("test.feature").write_text( textwrap.dedent( """ - Feature: Invalid Feature # Step not inside a scenario or background Given a step that is not inside a scenario or background + Feature: Invalid Feature Scenario: A valid scenario Given a step inside a scenario diff --git a/tox.ini b/tox.ini index 1409e8d0c..59cde7df7 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] -envlist = py{3.9,3.10,3.11}-pytest{7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2,8.3,latest}-gherkin_official{29,30,31,32,33,34,35,36,37,latest}-coverage - py{3.12,3.13,3.14}-pytest{7.3,7.4,8.0,8.1,8.2,8.3,latest}-gherkin_official{29,30,31,32,33,34,35,36,37,latest}-coverage +envlist = py{3.9,3.10,3.11}-pytest{7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2,8.3,latest}-gherkin_official{29,30,32,33,34,35,36,37,latest}-coverage + py{3.12,3.13,3.14}-pytest{7.3,7.4,8.0,8.1,8.2,8.3,latest}-gherkin_official{29,30,32,33,34,35,36,37,latest}-coverage py3.12-pytestlatest-xdist-coverage mypy @@ -17,7 +17,6 @@ deps = gherkin_official34: gherkin-official~=34.0.0 gherkin_official33: gherkin-official~=33.0.0 gherkin_official32: gherkin-official~=32.0.0 - gherkin_official31: gherkin-official~=31.0.0 gherkin_official30: gherkin-official~=30.0.0 gherkin_official29: gherkin-official~=29.0.0