add commons.retry: exponential-backoff retry as sync `retry` and async `aretry`, each usable as a call form or a decorator. backoff is min(backoff*factor**n, max_backoff) with optional full jitter; the schedule is a pure generator so it tests without real sleeps (sleep + rand injectable). `on=` narrows retryable exception types, `give_up(exc)` stops early on a non-retryable error, and after attempts are exhausted the LAST exception is re-raised (fail loud, never swallowed). de-dups retry logic written 3x divergently (aiowebhooks 429/5xx, aioproxies burn/rotate, aiomail reconnect). Signed-off-by: disqualifier <dev@disqualifier.me>
17 lines
433 B
TOML
17 lines
433 B
TOML
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[project]
|
|
name = "commons"
|
|
version = "0.2.0"
|
|
description = "small stdlib-only sync helpers: time/timezone deltas, dotted-path dict access, display masking, ip/address tooling, and retry/backoff"
|
|
requires-python = ">=3.10"
|
|
dependencies = []
|
|
|
|
[project.optional-dependencies]
|
|
addr = ["aiohttp>=3.9"]
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["src/commons"]
|