Closed hasier closed 10 months ago
⚠️ No release notes detected. Please make sure to use reno to add a changelog entry.
@jd I noticed black
checks are also failing in CI, but I think there is an incompatibility between black
and pep8
. The first one is trying to remove some whitespace, whereas the latter complains it wants the whitespace back. Is this something you can look at in the main
branch maybe?
I switched the project to ruff to solve this.
I switched the project to ruff to solve this.
Thanks @jd! Just re-formatted the changes with ruff
😊
⚠️ No release notes detected. Please make sure to use reno to add a changelog entry.
Sorry @jd just saw that dataclass(slots=True)
is only available from Python 3.10 onwards 🤦 I just fixed it by conditionally adding it, hopefully that looks ok to you! https://github.com/jd/tenacity/pull/434/commits/5b11340f997b8db6e48728006bd0dc6257c446fe
@jd how would you want to go about the chain of PRs? Do you want me to add a reno
note here and merge this set of changes first, or would you prefer to merge the 2 other PRs here, then just merge 1 big PR to main
? Happy to follow whichever process you prefer, let me know if you want me to update the PRs in any specific way.
As long as there is no external changes, we can skip the changelog entry.
First PR after breaking down https://github.com/jd/tenacity/pull/433
An attempt at DRYing the
iter()
function in order to supportasync
callbacks.The approach I have taken is to build a list of actions that
iter()
needs to go through, where each action is just a piece of the whole current logic, and each step can further extend the list of actions. 3 pieces have been taken out to redefine in specific Retrying implementations, i.e.asyncio
. This way we can make sure we use coroutines for those calls, as well as dynamically wrapping each function as a coroutine, allowing for both sync and async strategies and callbacks.