tooling: Async/pathlib/mypy cleanups and utils#17505
Conversation
38243f9 to
bd2bdf9
Compare
|
coverage is here https://storage.googleapis.com/envoy-pr/17505/tooling/index.html |
def7f0e to
e6b0e08
Compare
async_property method decoratorasync_property method decorator
454e737 to
a18e626
Compare
a18e626 to
16d400d
Compare
async_property method decoratorasync_property method decorator (+ more cleanups)
16d400d to
5f46745
Compare
a8fe24e to
13e6bd5
Compare
async_property method decorator (+ more cleanups)async_property method decorator (+ more cleanups)
|
ive figured out a better implementation that doesnt depend on gc for closing coroutines WIP while i reimplement... |
81b911b to
6c820c7
Compare
0abc53e to
3640423
Compare
534cae3 to
aa51d7e
Compare
- add `async_property` method decorator - make `runner.catches` work async - general py/test async improvements - mypy/typing cleanups - `os` -> `pathlib` cleanups Signed-off-by: Ryan Northey <ryan@synca.io>
aa51d7e to
13045a2
Compare
htuch
left a comment
There was a problem hiding this comment.
Looks good, generally prefer much smaller PRs but in this case it seems fine as a cleanup rollup.
yep, apologies, it kinda morphed also, mypy can be a bit of rabbit hole of type safety, and changing only some of the paths to pathlib was making it unhappy (as do functions/methods that can return more than one type) |
|
updated as an aside @htuch writing/testing so many props is making reconsider not using on my travels through the interwebs i read gvr saying somewhere that python was in the process of adopting some of the attrs features so i need to investigate this a bit further |
edaec32 to
f0a9b1e
Compare
f0a9b1e to
f2c11cf
Compare
|
/lgtm deps |
Signed-off-by: Ryan Northey ryan@synca.io
Commit Message: tooling: Improve async runner/test handling
Additional Description:
This Pr does a few things:
async_propertydecorator which is v handy for writing async classes-Werrorwhich is kinda necessary for catching asyncio unawaited errors.-Werror(as well as other incompatibilities)runner.catcheswork asyncmainplugin test to work asyncos->pathlibcleanups (Fix Use pythonpathlibmore and clean up some existing code with it #17487 )re the setuptools dep - i tried removing from docs requirements - but it wouldnt let me - setuptools works in mysterious ways
The decorator can be used as so:
it can also cache the results of the async call like so:
in this case repeated awaits of the property will return the cached results.
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Deprecated:]
[Optional API Considerations:]