Releases: modern-python/db-retry
Release list
0.5.1
db-retry 0.5.1 — release pipeline on PyPI Trusted Publishing
No library changes. The package is identical to 0.5.0; this release exercises the new publish path end-to-end.
CI
- Releases now authenticate to PyPI via Trusted Publishing (OIDC) instead of a long-lived
PYPI_TOKENsecret.uv publishauto-detects the GitHub Actions id-token; the release job runs under apypienvironment that scopes the trusted publisher (#29).
Downstream
No action required. Nothing about the installed package changes.
0.5.0
db-retry 0.5.0 — Python 3.11 and 3.12 support
The supported Python floor drops from 3.13 to 3.11. db-retry now runs on
Python 3.11, 3.12, 3.13, and 3.14. There are no behavior or public-API
changes — the five public symbols (postgres_retry,
build_connection_factory, build_db_dsn, is_dsn_multihost, Transaction)
and their signatures are unchanged.
What changed
requires-pythonis now>=3.11,<4(was>=3.13), with matching PyPI
classifiers for 3.11 and 3.12.postgres_retry's generics were rewritten off PEP 695. Thetypealias
statements anddef postgres_retry[**P, T]syntax (3.12+ only) became
module-leveltyping.ParamSpec/TypeVarwithTypeAliasaliases. No new
dependency — those are stdlib since 3.10. The decorator's behavior and the
two call forms (@postgres_retry/@postgres_retry(retries=N)) are
identical.
Downstream
No action needed beyond the wider version support — no API or behavior change.
A drop-in upgrade from 0.4.3 for projects already on 3.13+, and now installable
on 3.11 and 3.12.
Internals
- The refactor landed test-first with 100% coverage maintained.
- CI now runs the suite on a Python 3.11/3.12/3.13/3.14 matrix, with each leg
pinned to its target interpreter so every version is genuinely exercised.
0.4.3
db-retry 0.4.3 — internal architecture refactors, no API change
A maintenance release. Two capabilities were restructured for testability and
navigability; there are no behavior or public-API changes — the five public
symbols (postgres_retry, build_connection_factory, build_db_dsn,
is_dsn_multihost, Transaction) and their signatures are unchanged.
Internal refactors
- Retriable-error predicate seam. The retry decision (cause-chain walk +
asyncpg/SQLSTATE classification) moved out ofpostgres_retry's internals into
a pureis_retriable(exc) -> bool(new internaldb_retry/retriable.py), with
the retry-loop logging kept in a thin wrapper. The classification is now
unit-tested in memory instead of through a live-Postgres round-trip. Same
retriable classes (40001, class08), same logs, same surfaced exception. - Connection factory split.
build_connection_factorywas split into a pure
build_connection_plan(url) -> ConnectionPlan(URL parse, host/port pairing,
shuffle, multi/single-host branch) and a thin failover loop with a single
asyncpg.connectcall site. Host-plan parsing is now testable without mocking
asyncpg.connect. Same two-stage primary→failover strategy, same exceptions,
same load-balancing behavior.
Downstream
No action needed — no API or behavior change. A drop-in upgrade from 0.4.2.
Internals
- Both refactors landed test-first with 100% coverage maintained.
- Planning convention upgraded to 1.1.0 (adds the
architecture/glossary.md
ubiquitous-language page).
0.4.2
What's Changed
- Retry on advanced-alchemy wrapped exceptions by @lesnik512 in #12
Full Changelog: 0.4.1...0.4.2
0.4.1
0.4.0
What's Changed
- migrate to ty by @lesnik512 in #8
- refactor and fix by @lesnik512 in #9
Full Changelog: 0.3.0...0.4.0
0.3.0
0.2.2
What's Changed
- update README.md by @lesnik512 in #5
- fix settings prefix by @lesnik512 in #6
Full Changelog: 0.2.1...0.2.2
0.2.1
0.2.0
What's Changed
- rename to db-try, sync with internal version by @lesnik512 in #3
Full Changelog: 0.1.1...0.2.0