Conversation
Define an explicit public API surface by re-exporting the most commonly used classes (client, models, auth credentials, exceptions) from the top-level pyoverkiz package.
Cap total retry duration with max_time on each decorator and add full_jitter to avoid thundering herd on concurrent retries.
There was a problem hiding this comment.
Pull request overview
This PR aims to simplify the library’s public API by re-exporting commonly used symbols from pyoverkiz/__init__.py, and to make retry behavior more resilient by capping total retry duration and adding jitter to backoff decorators.
Changes:
- Add
max_timeandjitter=backoff.full_jitterto all reusablebackoff.on_exceptiondecorators inpyoverkiz/client.py. - Add package-root re-exports and an explicit
__all__inpyoverkiz/__init__.py.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
pyoverkiz/client.py |
Adds max_time and jitter to backoff decorators to cap retry duration and reduce thundering-herd retries. |
pyoverkiz/__init__.py |
Introduces top-level re-exports and __all__ to define a cleaner public import surface. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| from pyoverkiz.auth import ( | ||
| Credentials, | ||
| LocalTokenCredentials, | ||
| RexelOAuthCodeCredentials, | ||
| TokenCredentials, | ||
| UsernamePasswordCredentials, | ||
| ) |
There was a problem hiding this comment.
Importing credential classes from pyoverkiz.auth pulls in pyoverkiz.auth.factory and pyoverkiz.auth.strategies (via pyoverkiz/auth/__init__.py), which imports heavy optional runtime deps like boto3 at module import time. That makes a plain import pyoverkiz significantly heavier than necessary for users who only need models/exceptions. Prefer importing these symbols directly from pyoverkiz.auth.credentials (or use a lazy re-export via __getattr__) to keep top-level imports lightweight.
tetienne
left a comment
There was a problem hiding this comment.
Really clean PR — the alphabetical __all__ with re-exports is exactly the kind of public API hygiene that makes a library pleasant to use, and the full_jitter addition is a solid thundering-herd fix. A few things worth considering before this lands.
This reverts commit 27cc881.
…x_tries for execution limit
Summary
__all__and re-exports to package__init__.pyfor cleaner public APImax_timeandjitterto all backoff retry decorators for more resilient retry behaviorTest plan
pyoverkiz