Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Romfos authored Nov 5, 2024
2 parents 885d38d + 145fdd9 commit 6a2b14b
Show file tree
Hide file tree
Showing 26 changed files with 91 additions and 73 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ jobs:
- name: Show Python version
run: python --version

- uses: cucumber/action-publish-pypi@v2.0.0
- uses: cucumber/action-publish-pypi@v3.0.0
with:
working-directory: "python"
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
16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,19 @@ repos:
hooks:
- id: black
files: "^python/"
- repo: https://github.com/asottile/pyupgrade
rev: v3.18.0
hooks:
- id: pyupgrade
files: "^python/"
args: [ "--py39-plus" ]
- repo: https://github.com/pycqa/flake8
rev: "7.1.1"
hooks:
- id: flake8
files: "^python/"
args: [ "--toml-config=python/pyproject.toml" ]
additional_dependencies: [
"flake8-pyproject",
"flake8-bugbear",
]
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ This project adheres to [Semantic Versioning](http://semver.org).
This document is formatted according to the principles of [Keep A CHANGELOG](http://keepachangelog.com).

## [Unreleased]

## [30.0.0] - 2024-10-24
### Added
- [PHP, Java, Ruby, JavaScript] update dependency messages up to v26
- [Python] Added type annotations ([#283](https://github.com/cucumber/gherkin/pull/283))
Expand All @@ -24,10 +26,9 @@ 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.


## [29.0.0] - 2024-08-12
### Added
- (i18n) Added Gujarati translation for "Rule" ([#249](https://github.com/cucumber/gherkin/pull/249))
Expand Down Expand Up @@ -688,7 +689,8 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt
### Changed
- First release

[Unreleased]: https://github.com/cucumber/gherkin/compare/v29.0.0...HEAD
[Unreleased]: https://github.com/cucumber/gherkin/compare/v30.0.0...HEAD
[30.0.0]: https://github.com/cucumber/gherkin/compare/v29.0.0...v30.0.0
[29.0.0]: https://github.com/cucumber/gherkin/compare/v28.0.0...v29.0.0
[28.0.0]: https://github.com/cucumber/gherkin/compare/v27.0.0...v28.0.0
[27.0.0]: https://github.com/cucumber/gherkin/compare/v26.2.0...v27.0.0
Expand Down
2 changes: 1 addition & 1 deletion c/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
29.0.0
30.0.0
6 changes: 3 additions & 3 deletions dotnet/Gherkin/Gherkin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>

<PropertyGroup Label="Version">
<VersionNumber>29.0.0</VersionNumber>
<VersionNumber>30.0.0</VersionNumber>
<Version Condition="'$(SnapshotSuffix)' != ''">$(VersionNumber)-$(SnapshotSuffix)</Version>
<Version Condition="'$(SnapshotSuffix)' == ''">$(VersionNumber)</Version>
</PropertyGroup>
Expand All @@ -19,7 +19,7 @@
<Product>Gherkin Parser</Product>
<PackageId>Gherkin</PackageId>
<Authors>Cucumber Ltd, Gaspar Nagy</Authors>
<Copyright>Copyright © Cucumber Ltd, Gaspar Nagy</Copyright>
<Copyright>Copyright &#xA9; Cucumber Ltd, Gaspar Nagy</Copyright>
<Description>Cross-platform parser for the Gherkin language, used by Cucumber, SpecFlow and other Cucumber-based tools to parse feature files.</Description>
<PackageTags>specflow gherkin cucumber</PackageTags>
<PackageProjectUrl>https://github.com/cucumber/gherkin</PackageProjectUrl>
Expand All @@ -37,7 +37,7 @@
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="gherkin-languages.json" />
<EmbeddedResource Include="gherkin-languages.json"/>
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion elixir/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule CucumberGherkin.MixProject do
def project do
[
app: :cucumber_gherkin,
version: "29.0.0",
version: "30.0.0",
name: "CucumberGherkin",
description: description(),
package: package(),
Expand Down
2 changes: 1 addition & 1 deletion go/gherkin-generate-tokens/gherkin-generate-tokens.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"fmt"
gherkin "github.com/cucumber/gherkin/go/v29"
gherkin "github.com/cucumber/gherkin/go/v30"
"io"
"os"
"strings"
Expand Down
2 changes: 1 addition & 1 deletion go/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/cucumber/gherkin/go/v29
module github.com/cucumber/gherkin/go/v30

require (
github.com/cucumber/messages/go/v24 v24.1.0
Expand Down
2 changes: 1 addition & 1 deletion go/main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"encoding/json"
"flag"
"fmt"
gherkin "github.com/cucumber/gherkin/go/v29"
gherkin "github.com/cucumber/gherkin/go/v30"
"github.com/cucumber/messages/go/v24"
"os"
)
Expand Down
10 changes: 5 additions & 5 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
<version>4.2.0</version>
</parent>
<artifactId>gherkin</artifactId>
<version>29.0.1-SNAPSHOT</version>
<version>30.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Gherkin</name>
<description>Gherkin parser</description>
<url>https://github.com/cucumber/gherkin</url>

<properties>
<project.build.outputTimestamp>1723455193</project.build.outputTimestamp>
<project.build.outputTimestamp>1729755133</project.build.outputTimestamp>
<project.Automatic-Module-Name>io.cucumber.gherkin</project.Automatic-Module-Name>
</properties>

Expand All @@ -31,14 +31,14 @@
<dependency>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>2.18.0</version>
<version>2.18.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.11.2</version>
<version>5.11.3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -49,7 +49,7 @@
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>messages</artifactId>
<version>[19.1.4,27.0.0)</version>
<version>[19.1.4,28.0.0)</version>
</dependency>

<dependency>
Expand Down
30 changes: 16 additions & 14 deletions javascript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions javascript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cucumber/gherkin",
"version": "29.0.0",
"version": "30.0.0",
"description": "Gherkin parser",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
Expand Down Expand Up @@ -32,10 +32,10 @@
"homepage": "https://github.com/cucumber/gherkin",
"devDependencies": {
"@types/mocha": "10.0.9",
"@types/node": "20.16.11",
"@types/node": "20.17.6",
"commander": "^12.0.0",
"core-js": "3.38.1",
"mocha": "10.7.3",
"core-js": "3.39.0",
"mocha": "10.8.2",
"ts-node": "10.9.2",
"typescript": "5.6.3"
},
Expand Down
2 changes: 1 addition & 1 deletion perl/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
29.0.0
30.0.0
2 changes: 1 addition & 1 deletion perl/cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ requires "Class::XSAccessor";
requires "Cucumber::Messages", ">= 22.0.0, < 23.0.0";
requires "Data::UUID";
requires "Getopt::Long", "2.58";
requires "List::Util", "1.66";
requires "List::Util", "1.68";

on 'test' => sub {
requires "Path::Class";
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/gherkin/gherkin_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def table_cells(self) -> list[Cell]:
return cells

@staticmethod
def split_table_cells(row: str) -> Generator[tuple[str, int], None, None]:
def split_table_cells(row: str) -> Generator[tuple[str, int]]:
"""
An iterator returning all the table cells in a row with their positions,
accounting for escaping.
Expand Down
12 changes: 4 additions & 8 deletions python/gherkin/stream/gherkin_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ class Error(TypedDict):
parseError: ParseError


def create_errors(
errors: Iterable[ParserException], uri: str
) -> Generator[Error, None, None]:
def create_errors(errors: Iterable[ParserException], uri: str) -> Generator[Error]:
for error in errors:
yield {
"parseError": {
Expand Down Expand Up @@ -60,11 +58,9 @@ def __init__(self, options: Options) -> None:
self.parser = Parser(ast_builder=AstBuilder(self.id_generator))
self.compiler = Compiler(self.id_generator)

def enum(self, source_event: Event) -> Generator[
Event | Error | GherkinDocumentEnvelope | PickleEnvelope,
None,
None,
]:
def enum(
self, source_event: Event
) -> Generator[Event | Error | GherkinDocumentEnvelope | PickleEnvelope,]:
uri = source_event["source"]["uri"]
source = source_event["source"]["data"]

Expand Down
Loading

0 comments on commit 6a2b14b

Please sign in to comment.