behave-retry 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,44 @@
1
+ ---
2
+ name: Bug report
3
+ about: Report a bug or unexpected behavior
4
+ title: "[BUG] "
5
+ labels: bug
6
+ assignees: []
7
+ ---
8
+
9
+ ## Describe the bug
10
+
11
+ A clear and concise description of what the bug is.
12
+
13
+ ## To reproduce
14
+
15
+ Steps to reproduce the behavior:
16
+
17
+ 1. ...
18
+ 2. ...
19
+ 3. ...
20
+
21
+ Minimal code example:
22
+
23
+ ```python
24
+ # Your code here
25
+ ```
26
+
27
+ ## Expected behavior
28
+
29
+ What you expected to happen.
30
+
31
+ ## Actual behavior
32
+
33
+ What actually happened.
34
+
35
+ ## Environment
36
+
37
+ - **Python version:**
38
+ - **behave-retry version:**
39
+ - **behave version:**
40
+ - **OS:**
41
+
42
+ ## Additional context
43
+
44
+ Any other context, logs, or screenshots.
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest a new feature or enhancement
4
+ title: "[FEATURE] "
5
+ labels: enhancement
6
+ assignees: []
7
+ ---
8
+
9
+ ## Problem
10
+
11
+ A clear description of the problem this feature would solve.
12
+
13
+ ## Proposed solution
14
+
15
+ A description of what you want to happen.
16
+
17
+ ## Alternatives considered
18
+
19
+ Any alternative solutions or features you've considered.
20
+
21
+ ## Additional context
22
+
23
+ Any other context, screenshots, or examples.
@@ -0,0 +1,29 @@
1
+ ## Description
2
+
3
+ Brief description of the changes in this PR.
4
+
5
+ ## Type of change
6
+
7
+ - [ ] Bug fix (non-breaking change which fixes an issue)
8
+ - [ ] New feature (non-breaking change which adds functionality)
9
+ - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
10
+ - [ ] Documentation update
11
+ - [ ] Refactor (no functional changes)
12
+ - [ ] Test improvement
13
+
14
+ ## Related issues
15
+
16
+ Closes #
17
+
18
+ ## Checklist
19
+
20
+ - [ ] My code follows the project style (ruff passes)
21
+ - [ ] I have added tests for my changes
22
+ - [ ] All tests pass (`pytest tests/ -v`)
23
+ - [ ] Coverage stays at or above 90%
24
+ - [ ] I have updated the CHANGELOG.md (if applicable)
25
+ - [ ] I have updated the documentation (if applicable)
26
+
27
+ ## Additional notes
28
+
29
+ Any extra context for reviewers.
@@ -0,0 +1,59 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ test:
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ matrix:
17
+ python-version: ["3.11", "3.12", "3.13"]
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ - uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+ - run: pip install -e ".[dev]"
24
+ - run: ruff check .
25
+ - run: pytest tests/ -v --cov --cov-report=xml
26
+ - uses: codecov/codecov-action@v4
27
+ if: matrix.python-version == '3.12'
28
+ with:
29
+ file: ./coverage.xml
30
+
31
+ build:
32
+ needs: test
33
+ if: startsWith(github.ref, 'refs/tags/v')
34
+ runs-on: ubuntu-latest
35
+ steps:
36
+ - uses: actions/checkout@v4
37
+ - uses: actions/setup-python@v5
38
+ with:
39
+ python-version: "3.12"
40
+ - run: pip install build
41
+ - run: python -m build
42
+ - uses: actions/upload-artifact@v4
43
+ with:
44
+ name: dist
45
+ path: dist/
46
+
47
+ publish:
48
+ needs: build
49
+ if: startsWith(github.ref, 'refs/tags/v')
50
+ runs-on: ubuntu-latest
51
+ environment: pypi
52
+ permissions:
53
+ id-token: write
54
+ steps:
55
+ - uses: actions/download-artifact@v4
56
+ with:
57
+ name: dist
58
+ path: dist/
59
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,70 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ test:
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ matrix:
15
+ python-version: ["3.11", "3.12", "3.13"]
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - uses: actions/setup-python@v5
19
+ with:
20
+ python-version: ${{ matrix.python-version }}
21
+ - run: pip install -e ".[dev]"
22
+ - run: ruff check .
23
+ - run: pytest tests/ -v --cov
24
+
25
+ build:
26
+ needs: test
27
+ runs-on: ubuntu-latest
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+ - uses: actions/setup-python@v5
31
+ with:
32
+ python-version: "3.12"
33
+ - run: pip install build
34
+ - run: python -m build
35
+ - uses: actions/upload-artifact@v4
36
+ with:
37
+ name: dist
38
+ path: dist/
39
+
40
+ publish:
41
+ needs: build
42
+ runs-on: ubuntu-latest
43
+ environment: pypi
44
+ permissions:
45
+ id-token: write
46
+ steps:
47
+ - uses: actions/download-artifact@v4
48
+ with:
49
+ name: dist
50
+ path: dist/
51
+ - uses: pypa/gh-action-pypi-publish@release/v1
52
+
53
+ release-github:
54
+ needs: publish
55
+ runs-on: ubuntu-latest
56
+ permissions:
57
+ contents: write
58
+ steps:
59
+ - uses: actions/download-artifact@v4
60
+ with:
61
+ name: dist
62
+ path: dist/
63
+ - name: Create GitHub Release
64
+ env:
65
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66
+ run: |
67
+ gh release create "${{ github.ref_name }}" \
68
+ --title "${{ github.ref_name }}" \
69
+ --generate-notes \
70
+ dist/*
@@ -0,0 +1,14 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ dist/
5
+ build/
6
+ .eggs/
7
+ *.egg
8
+ .pytest_cache/
9
+ .coverage
10
+ htmlcov/
11
+ coverage.xml
12
+ .tox/
13
+ .mypy_cache/
14
+ .ruff_cache/
@@ -0,0 +1,21 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## [1.0.0] - 2026-07-13
6
+
7
+ ### Added
8
+
9
+ - `setup_retry()` — configure retry in `before_all` hook
10
+ - `after_scenario_hook()` — handle retry logic in `after_scenario`
11
+ - `retry_report()` — human-readable retry summary
12
+ - `RetryStats` and `ScenarioRetry` dataclasses for stats tracking
13
+ - `RetryConfig` dataclass for configuration
14
+ - `--retry N` CLI flag support
15
+ - `--retry-tags @tag` CLI flag for tag-filtered retry
16
+ - `--retry-on ExceptionType` CLI flag for exception-filtered retry
17
+ - `@retry:N` tag per scenario for override
18
+ - `@retry:0` tag to disable retry for a scenario
19
+ - `after_retry` hook support for cleanup between retries
20
+ - `RetryExhaustedError` exception
21
+ - Zero required dependencies
@@ -0,0 +1,132 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ - Demonstrating empathy and kindness toward other people
21
+ - Being respectful of differing opinions, viewpoints, and experiences
22
+ - Giving and gracefully accepting constructive feedback
23
+ - Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ - Focusing on what is best for the overall community, not just us as
26
+ individuals
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ - The use of sexualized language or imagery, and sexual attention or advances
31
+ of any kind
32
+ - Trolling, insulting or derogatory comments, and personal or political attacks
33
+ - Public or private harassment
34
+ - Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ - Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards
42
+ of acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for
49
+ moderation decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies
54
+ when an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail
56
+ address, posting via an official social media account, or acting as an
57
+ appointed representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ **conduct@mathiaspaulenko.com**.
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited
103
+ interaction with those enforcing the Code of Conduct, is allowed during this
104
+ period. Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][mozilla coc].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][faq]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [mozilla coc]: https://github.com/mozilla/diversity
131
+ [faq]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
@@ -0,0 +1,145 @@
1
+ # Contributing to behave-retry
2
+
3
+ Thank you for your interest in contributing to behave-retry! This document
4
+ covers everything you need to know to get started.
5
+
6
+ ## Prerequisites
7
+
8
+ - Python 3.11 or higher
9
+ - [uv](https://github.com/astral-sh/uv) or pip
10
+ - Git
11
+
12
+ ## Getting started
13
+
14
+ ```bash
15
+ git clone https://github.com/MathiasPaulenko/behave-retry.git
16
+ cd behave-retry
17
+ pip install -e ".[dev]"
18
+ ```
19
+
20
+ Verify your setup:
21
+
22
+ ```bash
23
+ ruff check .
24
+ pytest tests/ -v
25
+ ```
26
+
27
+ ## Development workflow
28
+
29
+ ### 1. Create a branch
30
+
31
+ ```bash
32
+ git checkout -b feat/my-feature
33
+ ```
34
+
35
+ Use the following prefixes:
36
+
37
+ - `feat/` — new features
38
+ - `fix/` — bug fixes
39
+ - `docs/` — documentation changes
40
+ - `refactor/` — code refactoring
41
+ - `test/` — test additions or fixes
42
+ - `chore/` — tooling, CI, dependencies
43
+
44
+ ### 2. Make your changes
45
+
46
+ - Follow the existing code style. Ruff enforces it automatically.
47
+ - Keep functions small and focused (single responsibility).
48
+ - Use type hints on all parameters and return types.
49
+ - Write docstrings in Google or NumPy format.
50
+ - Add or update tests for any changed behavior.
51
+
52
+ ### 3. Run checks locally
53
+
54
+ ```bash
55
+ ruff check .
56
+ pytest tests/ -v --cov
57
+ ```
58
+
59
+ Both must pass before opening a PR. Coverage must stay at or above 90%.
60
+
61
+ ### 4. Commit your changes
62
+
63
+ Write clear, concise commit messages. Use the imperative mood:
64
+
65
+ ```text
66
+ Add exception filtering to retry config
67
+ Fix off-by-one in retry attempt counter
68
+ Update README with API reference table
69
+ ```
70
+
71
+ ### 5. Open a pull request
72
+
73
+ Push your branch and open a PR against `main`. Fill in the PR template and
74
+ link any related issues.
75
+
76
+ ## Code style
77
+
78
+ This project uses [Ruff](https://github.com/astral-sh/ruff) with the following
79
+ rule sets: `E`, `F`, `W`, `I`, `N`, `UP`, `B`, `SIM`.
80
+
81
+ Key conventions:
82
+
83
+ - Line length: 100 characters
84
+ - Import sorting: `isort`-compatible (first-party: `behave_retry`)
85
+ - Use `from __future__ import annotations` in all modules
86
+ - Prefer dataclasses for structured data
87
+ - No comments that don't add value
88
+
89
+ ## Testing
90
+
91
+ Tests live in `tests/` and use `pytest`. The project uses fake objects
92
+ (`FakeScenario`, `FakeContext`) to test hooks without a real Behave runner.
93
+
94
+ ```bash
95
+ # Run all tests
96
+ pytest tests/ -v
97
+
98
+ # Run with coverage
99
+ pytest tests/ -v --cov
100
+
101
+ # Run a single test file
102
+ pytest tests/test_config.py -v
103
+ ```
104
+
105
+ ## Pull request guidelines
106
+
107
+ - One feature or fix per PR.
108
+ - Include tests for any new behavior.
109
+ - Keep PRs small and focused for easier review.
110
+ - Update the CHANGELOG.md under an `## [Unreleased]` section.
111
+ - Ensure CI passes: `ruff check .` and `pytest tests/ -v --cov`.
112
+
113
+ ## Reporting bugs
114
+
115
+ Open a [bug report issue](https://github.com/MathiasPaulenko/behave-retry/issues/new?template=bug_report.md)
116
+ and include:
117
+
118
+ - Python version
119
+ - behave-retry version
120
+ - Minimal reproduction steps
121
+ - Expected vs actual behavior
122
+
123
+ ## Suggesting features
124
+
125
+ Open a [feature request issue](https://github.com/MathiasPaulenko/behave-retry/issues/new?template=feature_request.md)
126
+ and describe:
127
+
128
+ - The problem you're trying to solve
129
+ - Your proposed solution
130
+ - Any alternatives you've considered
131
+
132
+ ## Release process
133
+
134
+ Releases are automated through GitHub Actions:
135
+
136
+ 1. Update `version` in `pyproject.toml` and `__version__` in `__init__.py`.
137
+ 2. Update `CHANGELOG.md` with the new version and date.
138
+ 3. Tag the commit: `git tag v1.x.x`.
139
+ 4. Push the tag: `git push origin v1.x.x`.
140
+ 5. CI builds the package and publishes to PyPI via trusted publishing (OIDC).
141
+
142
+ ## Questions?
143
+
144
+ Open a [discussion](https://github.com/MathiasPaulenko/behave-retry/discussions)
145
+ or an issue. We're happy to help.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mathias Paulenko
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.