Skip to content

Commit ea63bab

Browse files
authored
Merge branch 'main' into log-format
2 parents f59936d + 62787c3 commit ea63bab

File tree

11 files changed

+62
-55
lines changed

11 files changed

+62
-55
lines changed

.github/workflows/ci.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,32 @@ concurrency:
1414
jobs:
1515
test:
1616
timeout-minutes: 20
17-
runs-on: ubuntu-20.04
17+
runs-on: ubuntu-24.04
1818
strategy:
1919
matrix:
2020
include:
21-
- python: "3.8"
22-
tox: py38
2321
- python: "3.9"
2422
tox: py39
2523
- python: "3.10"
2624
tox: py310
2725
- python: "3.11"
2826
tox: py311
2927
- python: "3.12"
30-
tox: py312,py312-trio
28+
tox: py312
3129
- python: "3.12"
3230
tox: pep8
31+
- python: "3.13"
32+
tox: py313,py313-trio
3333
- python: "3.11"
3434
tox: mypy
3535
steps:
3636
- name: Checkout 🛎️
37-
uses: actions/checkout@v4.1.7
37+
uses: actions/checkout@v4.2.2
3838
with:
3939
fetch-depth: 0
4040

4141
- name: Setup Python 🔧
42-
uses: actions/setup-python@v5.1.1
42+
uses: actions/setup-python@v5.5.0
4343
with:
4444
python-version: ${{ matrix.python }}
4545
allow-prereleases: true

.github/workflows/deploy.yaml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: upload release to PyPI
2+
on:
3+
release:
4+
types:
5+
- published
6+
7+
jobs:
8+
pypi-publish:
9+
name: upload release to PyPI
10+
runs-on: ubuntu-latest
11+
environment: release
12+
permissions:
13+
id-token: write
14+
contents: write
15+
steps:
16+
- uses: actions/checkout@v4.2.2
17+
with:
18+
fetch-depth: 0
19+
fetch-tags: true
20+
21+
- uses: actions/setup-python@v5.5.0
22+
with:
23+
python-version: 3.13
24+
25+
- name: Install build
26+
run: |
27+
pip install setuptools-scm wheel
28+
29+
- name: Build
30+
run: |
31+
python setup.py sdist bdist_wheel
32+
33+
- name: Publish package distributions to PyPI
34+
uses: pypa/gh-action-pypi-publish@release/v1

.mergify.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ queue_rules:
1010
- files ~= ^releasenotes/notes/
1111
- label = no-changelog
1212
- author = dependabot[bot]
13-
- "check-success=test (3.8, py38)"
1413
- "check-success=test (3.9, py39)"
1514
- "check-success=test (3.10, py310)"
1615
- "check-success=test (3.11, py311)"
17-
- "check-success=test (3.12, py312,py312-trio)"
16+
- "check-success=test (3.12, py312)"
17+
- "check-success=test (3.13, py313,py313-trio)"
1818
- "check-success=test (3.12, pep8)"
1919

2020
pull_request_rules:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ build-backend="setuptools.build_meta"
1111
[tool.ruff]
1212
line-length = 88
1313
indent-width = 4
14-
target-version = "py38"
14+
target-version = "py39"
1515

1616
[tool.mypy]
1717
strict = true
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
fixes:
3+
- |
4+
Added `re.Pattern` to allowed match types.

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ classifier =
1313
Programming Language :: Python
1414
Programming Language :: Python :: 3
1515
Programming Language :: Python :: 3 :: Only
16-
Programming Language :: Python :: 3.8
1716
Programming Language :: Python :: 3.9
1817
Programming Language :: Python :: 3.10
1918
Programming Language :: Python :: 3.11
2019
Programming Language :: Python :: 3.12
20+
Programming Language :: Python :: 3.13
2121
Topic :: Utilities
2222

2323
[options]
2424
install_requires =
25-
python_requires = >=3.8
25+
python_requires = >=3.9
2626
packages = find:
2727

2828
[options.packages.find]

tenacity/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
from .after import after_log # noqa
7777
from .after import after_nothing # noqa
7878

79-
# Import all built-in after strategies for easier usage.
79+
# Import all built-in before sleep strategies for easier usage.
8080
from .before_sleep import before_sleep_log # noqa
8181
from .before_sleep import before_sleep_nothing # noqa
8282

@@ -88,6 +88,8 @@
8888
if t.TYPE_CHECKING:
8989
import types
9090

91+
from typing_extensions import Self
92+
9193
from . import asyncio as tasyncio
9294
from .retry import RetryBaseT
9395
from .stop import StopBaseT
@@ -255,7 +257,7 @@ def copy(
255257
retry_error_callback: t.Union[
256258
t.Optional[t.Callable[["RetryCallState"], t.Any]], object
257259
] = _unset,
258-
) -> "BaseRetrying":
260+
) -> "Self":
259261
"""Copy this object with some parameters changed if needed."""
260262
return self.__class__(
261263
sleep=_first_set(sleep, self.sleep),

tenacity/before_sleep.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626

2727
def before_sleep_nothing(retry_state: "RetryCallState") -> None:
28-
"""Before call strategy that does nothing."""
28+
"""Before sleep strategy that does nothing."""
2929

3030

3131
def before_sleep_log(
@@ -34,7 +34,7 @@ def before_sleep_log(
3434
exc_info: bool = False,
3535
sec_format: str = "%.3g",
3636
) -> typing.Callable[["RetryCallState"], None]:
37-
"""Before call strategy that logs to some logger the attempt."""
37+
"""Before sleep strategy that logs to some logger the attempt."""
3838

3939
def log_it(retry_state: "RetryCallState") -> None:
4040
local_exc_info: BaseException | bool | None

tenacity/retry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ class retry_if_exception_message(retry_if_exception):
207207
def __init__(
208208
self,
209209
message: typing.Optional[str] = None,
210-
match: typing.Optional[str] = None,
210+
match: typing.Union[None, str, typing.Pattern[str]] = None,
211211
) -> None:
212212
if message and match:
213213
raise TypeError(
@@ -242,7 +242,7 @@ class retry_if_not_exception_message(retry_if_exception_message):
242242
def __init__(
243243
self,
244244
message: typing.Optional[str] = None,
245-
match: typing.Optional[str] = None,
245+
match: typing.Union[None, str, typing.Pattern[str]] = None,
246246
) -> None:
247247
super().__init__(message, match)
248248
# invert predicate

0 commit comments

Comments
 (0)