Skip to content

Commit c1cd61f

Browse files
committed
Merge branch 'master' into ab/fix-typing
# Conflicts: # poetry.lock # src/pytest_bdd/cucumber_json.py # src/pytest_bdd/feature.py # src/pytest_bdd/generation.py # src/pytest_bdd/gherkin_terminal_reporter.py # src/pytest_bdd/parser.py # src/pytest_bdd/reporting.py # src/pytest_bdd/scenario.py # src/pytest_bdd/steps.py # src/pytest_bdd/utils.py # tests/feature/test_description.py
2 parents 51c2173 + 1e5595b commit c1cd61f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+5296
-1635
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Write a [Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) to show the bug.
15+
16+
**Expected behavior**
17+
A clear and concise description of what you expected to happen.
18+
19+
**Additional context**
20+
Add any other context about the problem here.
21+
22+
**Version**
23+
- pytest version:
24+
- pytest-bdd version:
25+
- OS:
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/workflows/main.yml

Lines changed: 106 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -6,81 +6,136 @@ on:
66
workflow_dispatch:
77

88
jobs:
9+
build:
10+
name: Build package
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
cache: "pip"
18+
- name: Install pypa/build
19+
run: >-
20+
python3 -m pip install --user
21+
build
22+
twine
23+
- name: Build a binary wheel and a source tarball
24+
run: python3 -m build
25+
- name: Check the distribution files with `twine`
26+
run: twine check --strict dist/*
27+
- name: Upload artifact
28+
id: artifact-upload-step
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: dist-files
32+
path: dist/*
33+
if-no-files-found: error
34+
compression-level: 0 # They are already compressed
935
test-run:
1036
runs-on: ubuntu-latest
37+
needs: build
1138
strategy:
1239
matrix:
1340
include:
14-
- python-version: "3.8"
15-
toxfactor: py3.8
16-
ignore-typecheck-outcome: true
17-
ignore-test-outcome: false
1841
- python-version: "3.9"
1942
toxfactor: py3.9
20-
ignore-typecheck-outcome: true
43+
ignore-typecheck-outcome: false
2144
ignore-test-outcome: false
2245
- python-version: "3.10"
2346
toxfactor: py3.10
24-
ignore-typecheck-outcome: true
47+
ignore-typecheck-outcome: false
2548
ignore-test-outcome: false
2649
- python-version: "3.11"
2750
toxfactor: py3.11
28-
ignore-typecheck-outcome: true
51+
ignore-typecheck-outcome: false
2952
ignore-test-outcome: false
3053
- python-version: "3.12"
3154
toxfactor: py3.12
32-
ignore-typecheck-outcome: true
55+
ignore-typecheck-outcome: false
56+
ignore-test-outcome: false
57+
- python-version: "3.13"
58+
toxfactor: py3.13
59+
ignore-typecheck-outcome: false
3360
ignore-test-outcome: false
3461

3562
steps:
36-
- uses: actions/checkout@v3
63+
- uses: actions/checkout@v4
3764

38-
- name: Set up Python ${{ matrix.python-version }}
39-
uses: actions/setup-python@v4
40-
id: setup-python
41-
with:
42-
python-version: ${{ matrix.python-version }}
65+
- name: Set up Python ${{ matrix.python-version }}
66+
uses: actions/setup-python@v4
67+
id: setup-python
68+
with:
69+
python-version: ${{ matrix.python-version }}
4370

44-
- name: Install poetry
45-
run: |
46-
python -m pip install poetry==1.6.1
71+
- name: Install poetry
72+
run: |
73+
python -m pip install poetry==1.8.3
4774
48-
- name: Configure poetry
49-
run: |
50-
python -m poetry config virtualenvs.in-project true
75+
- name: Configure poetry
76+
run: |
77+
python -m poetry config virtualenvs.in-project true
5178
52-
- name: Cache the virtualenv
53-
id: poetry-dependencies-cache
54-
uses: actions/cache@v3
55-
with:
56-
path: ./.venv
57-
key: ${{ runner.os }}-venv-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
79+
- name: Cache the virtualenv
80+
id: poetry-dependencies-cache
81+
uses: actions/cache@v3
82+
with:
83+
path: ./.venv
84+
key: ${{ runner.os }}-venv-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
5885

59-
- name: Install dev dependencies
60-
if: steps.poetry-dependencies-cache.outputs.cache-hit != 'true'
61-
run: |
62-
python -m poetry install --only=dev
86+
- name: Install dev dependencies
87+
if: steps.poetry-dependencies-cache.outputs.cache-hit != 'true'
88+
run: |
89+
python -m poetry install --only=dev
6390
64-
- name: Type checking
65-
# Ignore errors for older pythons
66-
continue-on-error: ${{ matrix.ignore-typecheck-outcome }}
67-
run: |
68-
source .venv/bin/activate
69-
tox -e mypy
91+
- name: Download artifact
92+
uses: actions/download-artifact@v4
93+
with:
94+
name: dist-files
95+
path: dist/
7096

71-
- name: Test with tox
72-
continue-on-error: ${{ matrix.ignore-test-outcome }}
73-
run: |
74-
source .venv/bin/activate
75-
coverage erase
76-
tox run-parallel -f ${{ matrix.toxfactor }} --parallel-no-spinner --parallel-live
77-
coverage combine
78-
coverage xml
97+
- name: Type checking
98+
# Ignore errors for older pythons
99+
continue-on-error: ${{ matrix.ignore-typecheck-outcome }}
100+
run: |
101+
source .venv/bin/activate
102+
tox -e mypy
79103
80-
- uses: codecov/codecov-action@v3
81-
with:
82-
# Explicitly using the token to avoid Codecov rate limit errors
83-
# See https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
84-
token: ${{ secrets.CODECOV_TOKEN }}
85-
fail_ci_if_error: true
86-
verbose: true # optional (default = false)
104+
- name: Test with tox
105+
continue-on-error: ${{ matrix.ignore-test-outcome }}
106+
run: |
107+
source .venv/bin/activate
108+
coverage erase
109+
# Using `installpkg dist/*.tar.gz` because we want to install the pre-built package (want to test against that)
110+
tox run-parallel -f ${{ matrix.toxfactor }} --parallel-no-spinner --parallel-live --installpkg dist/*.whl
111+
coverage combine
112+
coverage xml
113+
114+
- uses: codecov/codecov-action@v4
115+
with:
116+
# Explicitly using the token to avoid Codecov rate limit errors
117+
# See https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
118+
token: ${{ secrets.CODECOV_TOKEN }}
119+
fail_ci_if_error: false
120+
verbose: true # optional (default = false)
121+
122+
pypi-publish:
123+
name: Upload release to PyPI
124+
runs-on: ubuntu-latest
125+
environment:
126+
name: pypi
127+
url: https://pypi.org/p/pytest-bdd
128+
permissions:
129+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
130+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
131+
needs:
132+
- "test-run"
133+
- "build"
134+
steps:
135+
- name: Download artifact
136+
uses: actions/download-artifact@v4
137+
with:
138+
name: dist-files
139+
path: dist/
140+
- name: Publish package distributions to PyPI
141+
uses: pypa/gh-action-pypi-publish@release/v1

.pre-commit-config.yaml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,31 @@
33
repos:
44
- repo: https://github.com/psf/black
55
# If you update the version here, also update it in tox.ini (py*-pytestlatest-linters)
6-
rev: 23.11.0
6+
rev: 24.10.0
77
hooks:
88
- id: black
99
- repo: https://github.com/pycqa/isort
10-
rev: 5.12.0
10+
rev: 5.13.2
1111
hooks:
1212
- id: isort
1313
name: isort (python)
1414
- repo: https://github.com/pre-commit/pre-commit-hooks
15-
rev: v4.5.0
15+
rev: v5.0.0
1616
hooks:
1717
- id: trailing-whitespace
1818
- id: end-of-file-fixer
1919
- id: check-yaml
2020
- id: check-added-large-files
2121
- repo: https://github.com/asottile/pyupgrade
22-
rev: v3.15.0
22+
rev: v3.19.0
2323
hooks:
2424
- id: pyupgrade
25-
args: ["--py38-plus"]
26-
# TODO: Enable mypy checker when the checks succeed
27-
#- repo: https://github.com/pre-commit/mirrors-mypy
28-
# rev: v0.931
29-
# hooks:
30-
# - id: mypy
31-
# additional_dependencies: [types-setuptools]
25+
args: ["--py39-plus"]
26+
- repo: https://github.com/pycqa/flake8
27+
rev: "7.1.1"
28+
hooks:
29+
- id: flake8
30+
additional_dependencies: [
31+
"flake8-pyproject",
32+
"flake8-bugbear",
33+
]

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
version: 2
66

77
build:
8-
os: ubuntu-22.04
8+
os: ubuntu-24.04
99
tools:
1010
python: "3"
1111

AUTHORS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ These people have contributed to `pytest-bdd`, in alphabetical order:
1919
* `Floris Bruynooghe <[email protected]>`_
2020
* `Harro van der Klauw <[email protected]>`_
2121
* `Hugo van Kemenade <https://github.com/hugovk>`_
22+
* `Kyle Adams <https://github.com/kadams54>`_
2223
* `Laurence Rowe <[email protected]>`_
2324
* `Leonardo Santagada <[email protected]>`_
2425
* `Milosz Sliwinski <sliwinski-milosz>`_

0 commit comments

Comments
 (0)