-
-
Notifications
You must be signed in to change notification settings - Fork 178
Conversation
A nice function that gets and returns the future that is much more easier to manage without users of asyncio having to hack duck type it just to see if ensure_future exists or not. Bad for coverage with packages like aiohttp which operates on a future that is unsure and bugs coverage services like Codecov. With this they are for sure to get the correct future for their version of asyncio.
I'm not sure I see any utility in the proposed |
The issue is because of this mostly: https://codecov.io/gh/KeepSafe/aiohttp/compare/8469b6dea75c17732fd4de5ef3a1846cadf220cb...3dc08a056c0b7fa1d3d2f8ec2b53e9fb60646bec Many packages which also supports Python 3.4 has this problem with getting the future on things like |
This doesn't make sense to me. You're adding this to the file containing |
Take a look at the URL provided. It is a great workaround if it was Added for not only 3.4 but also for 3.5+ |
That link is a 404 for me. |
Fixed it. the reason why putting it inside of aiohttp is bad is because it jacks with the PR making it's check fail. aio-libs/aiohttp#1521. |
The fixed link works, but nothing will add that function to the stdlib for Python versions that don't have it, so people will still write the try/except. I stand by my opinion that this is the wrong way to fix it. |
hmm unless one can go in and do try:
ensure_future = asyncio.ascync
except DeprecationWarning:
ensure_future = asyncio.ensure_future But I am sure the |
It makes sense to add that to the user code (or even to libraries that depend on asyncio). But it doesn't make sense to add that to asyncio itself. |
@AraHaan Shouldn't it be the reverse? Something like:
|
oh yeah |
For maximum future-proofing I'd recommend ensure_future = getattr(asyncio, 'ensure_future', getattr(asyncio, 'async', None)) This will work in the distant future when |
ok, also I noticed a problem with distutils which was closed as not a distutils problem but if they read the actual setuptools and distrubute source codes they would find they both use distutils for their setup function so it really is a distutils issue more info on that here: pypa/setuptools#906 setup = distutils.core.setup The line in question on setuptools is here: https://github.com/pypa/setuptools/blob/master/setuptools/__init__.py#L112 But yeah my current idea for the solution is either get them to update distutils to work on that for 3.7, 3.6.1, and 3.5.3 or to have setuptools steal the setup function from distutils only to monkey patch it to accept bugtrack_url. The bugtrack issue that was closed: http://bugs.python.org/issue29115 |
I'm locking this conversation. Please report bugs for other projects on their issue trackers. |
A nice function that gets and returns the future that is much more
easier to manage without users of asyncio having to hack duck type it
just to see if ensure_future exists or not. Bad for coverage with
packages like aiohttp which operates on a future that is unsure and bugs
coverage services like Codecov. With this they are for sure to get the
correct future for their version of asyncio.
Note: Will update this PR if and builds on this fails to ensure the function works as intended.