Skip to content
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

bpo-36373: Deprecate explicit loop parameter in all public asyncio APIs [task] [WIP] #13670

Closed
wants to merge 3 commits into from

Conversation

@eamanu
Copy link
Contributor

commented May 30, 2019

This PR deprecate explicit loop parameters in all public asyncio APIs

This issues is split to be easier to review.

First step: tasks.py

https://bugs.python.org/issue36373

bpo-36373: Deprecate explicit loop parameter
This PR deprecate explicit loop parameters in all public asyncio APIs

This issues is split to be easier to review.

First step: tasks.py

@eamanu eamanu requested review from 1st1 and asvetlov as code owners May 30, 2019

@eamanu eamanu changed the title bpo-36373:Deprecate explicit loop parameter in all public asyncio APIs bpo-36373: Deprecate explicit loop parameter in all public asyncio APIs May 30, 2019

@tirkarthi
Copy link
Contributor

left a comment

Please handle DeprecationWarning in the tests. Running with -Werror would give test failures due to warnings.

@asvetlov
Copy link
Contributor

left a comment

Agree with @tirkarthi
./python -Werror -m test should pass
You can find the following command useful in development:
`./python -Werror -m test -v test_asyncio"

@bedevere-bot

This comment has been minimized.

Copy link

commented May 30, 2019

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

And if you don't make the requested changes, you will be poked with soft cushions!

@eamanu eamanu changed the title bpo-36373: Deprecate explicit loop parameter in all public asyncio APIs bpo-36373: Deprecate explicit loop parameter in all public asyncio APIs [task] Jun 5, 2019

@asvetlov
Copy link
Contributor

left a comment

Please run the PR with ./python -Werror -m test --check-env-changed -v test_asyncio and make sure that the test run is succeded.

@@ -659,6 +672,10 @@ class _GatheringFuture(futures.Future):
"""

def __init__(self, children, *, loop=None):
if loop:

This comment has been minimized.

Copy link
@asvetlov

asvetlov Jun 5, 2019

Contributor

This check is redundant: asyncio.gather() always passes loop to internal _GatheringFuture constructor.

@@ -116,6 +116,10 @@ def all_tasks(cls, loop=None):
return _all_tasks_compat(loop)

def __init__(self, coro, *, loop=None, name=None):
if loop:
warnings.warn("The loop argument is deprecated since Python 3.8, "

This comment has been minimized.

Copy link
@asvetlov

asvetlov Jun 5, 2019

Contributor

Task is called with explicit loop by loop.create_task() method, please drop the check

@codecov

This comment has been minimized.

Copy link

commented Jun 8, 2019

Codecov Report

Merging #13670 into master will decrease coverage by <.01%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13670      +/-   ##
==========================================
- Coverage   82.78%   82.78%   -0.01%     
==========================================
  Files        1842     1842              
  Lines      559265   559276      +11     
  Branches    41382    41387       +5     
==========================================
- Hits       463009   462990      -19     
- Misses      87188    87209      +21     
- Partials     9068     9077       +9
Impacted Files Coverage Δ
Lib/asyncio/tasks.py 94.73% <66.66%> (-0.77%) ⬇️
Lib/idlelib/runscript.py 19.09% <0%> (-1.82%) ⬇️
Lib/idlelib/scrolledlist.py 36.6% <0%> (-1.79%) ⬇️
Lib/test/test_asyncio/functional.py 70.65% <0%> (-1.64%) ⬇️
Lib/heapq.py 94.53% <0%> (-1.57%) ⬇️
Lib/idlelib/squeezer.py 91.94% <0%> (-1.35%) ⬇️
Lib/test/test_capi.py 93.4% <0%> (-0.8%) ⬇️
Lib/_weakrefset.py 59.18% <0%> (-0.69%) ⬇️
Lib/socketserver.py 80% <0%> (-0.34%) ⬇️
Lib/test/test_random.py 96.43% <0%> (-0.31%) ⬇️
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8087831...0706c1b. Read the comment docs.

@eamanu eamanu changed the title bpo-36373: Deprecate explicit loop parameter in all public asyncio APIs [task] bpo-36373: Deprecate explicit loop parameter in all public asyncio APIs [task] [WIP] Jun 8, 2019

@asvetlov

This comment has been minimized.

Copy link
Contributor

commented Sep 12, 2019

The work is merged as a part of #16033

@asvetlov asvetlov closed this Sep 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.