-
-
Notifications
You must be signed in to change notification settings - Fork 304
Fix #291: drop python < 3.6 #304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
|
|
||
| class BaseRetrying(object): | ||
| __metaclass__ = ABCMeta |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like here was s bug
| return fut.result() | ||
|
|
||
| if self.after is not None: | ||
| self.after(retry_state=retry_state) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use keyword call
| from monotonic import monotonic as now # noqa | ||
|
|
||
|
|
||
| class cached_property(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not used at code base -> no reason to migrate on backports or make semi-stdlib code
| def test_repr(self): | ||
| class ConcreteRetrying(tenacity.BaseRetrying): | ||
| def __call__(self): | ||
| def __call__(self, fn, *args, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not modify signature
| ) | ||
| if iscoroutinefunction is not None and iscoroutinefunction(f): | ||
| r = AsyncRetrying(*dargs, **dkw) | ||
| r: "BaseRetrying" = AsyncRetrying(*dargs, **dkw) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using base class due to API reuse and MyPy questions
| break | ||
|
|
||
| @abstractmethod | ||
| def __call__(self, *args, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API should match between parent and child classes
| def call(self, *args, **kwargs): | ||
| def call(self, *args: t.Any, **kwargs: t.Any) -> t.Union[DoAttempt, DoSleep, t.Any]: | ||
| """Use ``__call__`` instead because this method is deprecated.""" | ||
| warnings.warn( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like reason to set deprecation period before remove (and also for bound function in Retrying)
|
|
||
|
|
||
| def visible_attrs(obj, attrs=None): | ||
| def visible_attrs( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
method is used only once and technically 1liner -> dict comprehension in place of use?
jd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of minor things otherwise LGTM.
(I'd have preferred to have multiple PR for different things here: removing Python 2 is one thing, adding typing information is another.)
Thanks for doing this huge work!
#293 is repared, so I can rebase on it after merge. It will reduce size of mine PR |
|
Rebased on master |
jd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto for the six and typing which should be 2 different PR, but if it's complicated to split them, it'll be fine.
|
|
||
|
|
||
| def before_log(logger, log_level): | ||
| def before_log(logger: "logging.Logger", log_level: int) -> typing.Callable[["RetryCallState"], None]: # noqa:BLK100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just run black?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will make separate PR with unified black formatting
* Removed all transitional requirements (including `six`) * Most type annotations fixed. * Python 3.10 tested. * Most part of code is type annotated. Co-authored-by: Julien Danjou <julien@danjou.info>
|
manually rebased to make history float |
six)