Open jeffsawatzky opened 1 month ago
No plans to add this, but would be happy to consider a pull request. It doesn't seem like it'd be a huge lift, and the current tests for unit / integration should catch any regressions.
If anyone does pick this up to do it, I think I'd rather switch ot using httpx
rather than modifying requests
(or using grequests
) to accomplish this, since that feels hacky. To start this work then, we'd first need to replace requests
with httpx
throughout the code (primarily in AmazonSession
, since that's pretty coupled to requestsSession object (but the comparable way to do this in
httpxwould be with its [
Client`](https://www.python-httpx.org/advanced/clients/)).
The biggest lift beyond this will probably be refactoring tests, which currently very conveniently uses responses.activate
to mock responses. I haven't looked in to what / if httpx
has a good alternative to this, or if we're going to have to roll our own monkeypatch for each test.
Once the coupling with AmazonSession is replaced, the remaining code to add awaits
is a pretty small lift from there.
For httpx there is pytest_httpx
Would you want both sync and async support, or are you ok with dropping sync altogether?
Nice!
I think we'd want to maintain both, but I haven't thought about it enough to decide if users would lose anything they might miss if we dropped sync support ... I'll noodle on it, would be curious to know your thoughts.
Acknowledgements
debug
mode and am attaching relevant console logs and HTML filesDescribe the Feature
Would you be open to adding asyncio support using either httpx or aiohttp?
might help speed up loading as it is currently pretty slow.
Describe Alternative Solutions/Workarounds
Other options are using something like gevent maybe? But asyncio seems cleaner.