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 [streams] #13671

Merged
merged 3 commits into from Jun 5, 2019

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.

Second step: streams.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.

Second step: streams.py
@asvetlov
Copy link
Contributor

left a comment

Please remove all deprecations in public API but add these warnings to open_connection(), start_server(), open_unix_connection(), start_unix_server() instead.

Lib/asyncio/streams.py Outdated Show resolved Hide resolved
Lib/asyncio/streams.py Outdated Show resolved Hide resolved
@@ -753,6 +761,9 @@ def __init__(self, limit=_DEFAULT_LIMIT, loop=None):
self._loop = events.get_event_loop()
else:
self._loop = loop
warnings.warn("The loop argument is deprecated since Python 3.8, "

This comment has been minimized.

Copy link
@asvetlov

asvetlov May 30, 2019

Contributor

Private API, people should never create StreamReader class explicitly but use await open_connection() and family.

This comment has been minimized.

Copy link
@eamanu

eamanu May 31, 2019

Author Contributor

removed it

@@ -1297,6 +1308,9 @@ def __init__(self, mode, *,
self._loop = events.get_event_loop()
else:
self._loop = loop
warnings.warn("The loop argument is deprecated since Python 3.8, "

This comment has been minimized.

Copy link
@asvetlov

asvetlov May 30, 2019

Contributor

Private API

This comment has been minimized.

Copy link
@eamanu

eamanu May 31, 2019

Author Contributor

removed it

@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.

@eamanu

This comment has been minimized.

Copy link
Contributor Author

commented May 31, 2019

I have made the requested changes; please review again

@bedevere-bot

This comment has been minimized.

Copy link

commented May 31, 2019

Thanks for making the requested changes!

@asvetlov: please review the changes made to this pull request.

@eamanu

This comment has been minimized.

Copy link
Contributor Author

commented May 31, 2019

@asvetlov the News Could be skipped?

@asvetlov
Copy link
Contributor

left a comment

Please run your PR by ./python -Weeror -m test -v test_asyncio.
I suspect that some tests will fail (but didn't check it myself).
These tests should be wrapped by with self.assertWarns(DeprecationWarning): ... construction

@@ -610,6 +626,9 @@ class StreamReaderProtocol(FlowControlMixin, protocols.Protocol):

def __init__(self, stream_reader, client_connected_cb=None, loop=None,
*, _asyncio_internal=False):
warnings.warn("The loop argument is deprecated since Python 3.8, "

This comment has been minimized.

Copy link
@asvetlov

asvetlov May 31, 2019

Contributor

This class is actually private API. Please remove the warning, I pretty sure that asyncio factories like open_connection always send the loop. Double deprecation is redundant.

This comment has been minimized.

Copy link
@Carreau

Carreau May 31, 2019

Contributor

If so it should be documented as private, it does not appear to be : https://docs.python.org/3.6/library/asyncio-stream.html#streamreaderprotocol

And a quick search returns case of people passing the loop argument to it.
https://github.com/ssfdust/pyclewn/blob/555f2e5485f9938078adfe19388a0e1bb8af67f5/lib/clewn/tty.py#L119

This comment has been minimized.

Copy link
@asvetlov

asvetlov May 31, 2019

Contributor

Agree, it should be documented properly.
I've added _asyncio_internal flag.
Also, asincio.__init__ has __getattr__() now to raise DeprecationWarning for importing StreamReader, StreamWriter and StreamReaderProtocol.
We have an agreement with @1st1 to land asyncio streams code changes first and document them later before Release Candidate stage.

I supposed to make a PR for documentation. If somebody would help me -- I very appreciate this.
Especially taking into account that my English is rough :(
Usually Yuri replaces almost every my sentence on review :)

This comment has been minimized.

Copy link
@eamanu

eamanu Jun 5, 2019

Author Contributor

Hi @asvetlov I will help with the docs. :-)

@bedevere-bot

This comment has been minimized.

Copy link

commented May 31, 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.

@asvetlov asvetlov added the skip news label May 31, 2019

@asvetlov
Copy link
Contributor

left a comment

please drop the check here

@eamanu

This comment has been minimized.

Copy link
Contributor Author

commented Jun 5, 2019

I have made the requested changes; please review again

@bedevere-bot

This comment has been minimized.

Copy link

commented Jun 5, 2019

Thanks for making the requested changes!

@asvetlov: please review the changes made to this pull request.

@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 [streams] Jun 5, 2019

@eamanu

This comment has been minimized.

Copy link
Contributor Author

commented Jun 5, 2019

@asvetlov I run the ./python -Weeror -m test -v test_asyncio and the test are ok

Ran 2145 tests in 80.981s

OK (skipped=35)
test_asyncio passed in 1 min 21 sec

== Tests result: SUCCESS ==

1 test OK.

Total duration: 1 min 21 sec
Tests result: SUCCESS

@miss-islington miss-islington merged commit 6d64a8f into python:master Jun 5, 2019

5 checks passed

Azure Pipelines PR #20190605.6 succeeded
Details
bedevere/issue-number Issue number 36373 found
Details
bedevere/news "skip news" label found
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@miss-islington

This comment has been minimized.

Copy link

commented Jun 5, 2019

Sorry, I can't merge this PR. Reason: Base branch was modified. Review and try the merge again..

@miss-islington

This comment has been minimized.

Copy link

commented Jun 5, 2019

Thanks @eamanu for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒🤖

@bedevere-bot

This comment has been minimized.

Copy link

commented Jun 5, 2019

GH-13833 is a backport of this pull request to the 3.8 branch.

@asvetlov

This comment has been minimized.

Copy link
Contributor

commented Jun 5, 2019

Thank you @eamanu
Last days I was busy by firefighting with bugs to make 3.8 beta released.

The next big target is asyncio documentation cleanup (plus I need to land multithreaded support back again).

@asvetlov

This comment has been minimized.

Copy link
Contributor

commented Jun 5, 2019

@eamanu would you take a look on asyncio/locks.py and asyncio/queues.py?

miss-islington added a commit that referenced this pull request Jun 5, 2019
bpo-36373: Deprecate explicit loop parameter in all public asyncio AP…
…Is [streams] (GH-13671)

This PR deprecate explicit loop parameters in all public asyncio APIs

This issues is split to be easier to review.

Second step: streams.py

https://bugs.python.org/issue36373
(cherry picked from commit 6d64a8f)

Co-authored-by: Emmanuel Arias <emmanuelarias30@gmail.com>
@eamanu

This comment has been minimized.

Copy link
Contributor Author

commented Jun 5, 2019

@eamanu would you take a look on asyncio/locks.py and asyncio/queues.py?

@asvetlov Yes yes, I will start work on that today. I was busy the last weekend. And I have pending #13670

@eamanu eamanu deleted the eamanu:bpo-36373-streams branch Jun 5, 2019

@asvetlov

This comment has been minimized.

Copy link
Contributor

commented Jun 5, 2019

Thank you. No rush, we have enough time during betas

PatrikKopkan pushed a commit to PatrikKopkan/cpython that referenced this pull request Sep 6, 2019
bpo-36373: Deprecate explicit loop parameter in all public asyncio AP…
…Is [streams] (pythonGH-13671)

This PR deprecate explicit loop parameters in all public asyncio APIs

This issues is split to be easier to review.

Second step: streams.py





https://bugs.python.org/issue36373
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.