GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-94597: deprecate asyncio.set_event_loop_policy by graingert · Pull Request #110728 · python/cpython

Conversation

@graingert

@graingert graingert commented Oct 11, 2023 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

📚 Documentation preview 📚: https://cpython-previews--110728.org.readthedocs.build/

  • Issue: deprecate the asyncio child watchers system #94597

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@graingert graingert changed the title deprecate asyncio.set_event_loop_policy gh-94597: deprecate asyncio.set_event_loop_policy Oct 11, 2023
@bedevere-app bedevere-app Bot mentioned this pull request Oct 11, 2023
deprecate the asyncio child watchers system #94597
Closed
@graingert
graingert force-pushed the deprecate-set-event-loop-policy branch 4 times, most recently from a7fe31c to 339445e Compare October 11, 2023 17:18
graingert and others added 5 commits October 11, 2023 19:14
@graingert
deprecate asyncio.set_event_loop_policy
a1fa657
@graingert
update set_event_loop_policy docs
b8256f7
@blurb-it @graingert
📜🤖 Added by blurb_it.
f56d368
@graingert
test the deprecation warning
8700b61
@graingert
add support.set_event_loop_policy for setting the event loop policy i…
491b42e
…n tests
@graingert
graingert force-pushed the deprecate-set-event-loop-policy branch from f7a1b68 to 491b42e Compare October 11, 2023 18:14
@graingert
graingert marked this pull request as ready for review October 11, 2023 18:41
@graingert
graingert requested review from 1st1, JelleZijlstra, asvetlov, cjw296, gvanrossum, kumaraditya303, rhettinger, vsajip and willingc as code owners October 11, 2023 18:41
@bedevere-app bedevere-app Bot added the awaiting review label Oct 11, 2023
cjw296
cjw296 reviewed Oct 11, 2023
View reviewed changes

@cjw296 cjw296 left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No objection to the unittest or AsyncMock changes!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@JelleZijlstra
JelleZijlstra removed their request for review October 12, 2023 02:18
@rhettinger
rhettinger removed their request for review October 16, 2023 03:47
@gvanrossum gvanrossum mentioned this pull request Oct 26, 2023
gh-79033: Try to fix asyncio.Server.wait_closed() again #111336
Merged
gvanrossum
gvanrossum reviewed Oct 26, 2023
View reviewed changes

@gvanrossum gvanrossum left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few nits, basically LG. That tearDownModule() pattern is annoying! :-)

I assume that deprecating get_event_loop_policy() will follow? Are there other APIs? I'm guessing we also want to avoid instantiating or subclassing the standard event loop policy classes (I expect this will turn up some significant uses of them).

Before we merge this we may need to bring this up on discuss.python.org (in the asyncio category) to see if there are significant objections to the proposed deprecation schedule.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/asyncio-policy.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/asyncio/events.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/test/test_asyncio/test_events.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Misc/NEWS.d/next/Library/2023-10-11-15-55-53.gh-issue-94597.qXo8Q4.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@graingert @gvanrossum
Update Misc/NEWS.d/next/Library/2023-10-11-15-55-53.gh-issue-94597.qX…
c081c67
…o8Q4.rst

Co-authored-by: Guido van Rossum <[email protected]>
@graingert

graingert commented Oct 26, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Just a few nits, basically LG. That tearDownModule() pattern is annoying! :-)

I think we can start getting rid of those tearDownModules using #110774

I assume that deprecating get_event_loop_policy() will follow? Are there other APIs? I'm guessing we also want to avoid instantiating or subclassing the standard event loop policy classes (I expect this will turn up some significant uses of them).

Yep currently that's a bit more complicated because get/set_event_loop calls get_event_loop_policy and afaik we don't want to make get_event_loop an alias of get_running_loop anymore

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

graingert added 2 commits October 31, 2023 16:28
@graingert
Update Lib/asyncio/events.py
b41756d
@graingert
doc set_event_loop_policy removal schedule
ec3907d
hugovk
hugovk reviewed Oct 31, 2023
View reviewed changes
Comment thread Doc/whatsnew/3.13.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@graingert @hugovk
Update Doc/whatsnew/3.13.rst
c81b51a
Co-authored-by: Hugo van Kemenade <[email protected]>
@graingert

graingert commented Oct 31, 2023

Copy link
Copy Markdown
Contributor Author

Before we merge this we may need to bring this up on discuss.python.org (in the asyncio category) to see if there are significant objections to the proposed deprecation schedule.

discuss post posted here: https://discuss.python.org/t/removing-the-asyncio-policy-system-asyncio-set-event-loop-policy-in-python-3-15/37553

willingc reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gvanrossum
gvanrossum approved these changes Oct 31, 2023
View reviewed changes

@gvanrossum gvanrossum left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'm happy with this. Let's wait a bit if anyone brings up substantial objections in the Discourse thread.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Oct 31, 2023
willingc
willingc approved these changes Oct 31, 2023
View reviewed changes

@willingc willingc left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bravo @graingert for simplifying. ✨

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
kumaraditya303
kumaraditya303 requested changes Nov 1, 2023
View reviewed changes

@kumaraditya303 kumaraditya303 left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add a notice under asyncio changes, most users like myself won't look under 3.15 removals for this change. Thanks

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting changes and removed awaiting merge labels Nov 1, 2023
@bedevere-app

bedevere-app Bot commented Nov 1, 2023

Copy link
Copy Markdown

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!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@graingert

graingert commented Nov 1, 2023

Copy link
Copy Markdown
Contributor Author

Please also add a notice under asyncio changes, most users like myself won't look under 3.15 removals for this change. Thanks

Can you link me to the location in the docs that you mean please?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kumaraditya303

kumaraditya303 commented Nov 1, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Can you link me to the location in the docs that you mean please?

Add asyncio entry in https://docs.python.org/3.13/whatsnew/3.13.html#deprecated

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugovk

hugovk commented Nov 1, 2023

Copy link
Copy Markdown
Member

That sounds fine, then let's move it from the "Pending Removal in Python 3.15" section to this one.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

graingert added 2 commits November 1, 2023 18:55
@graingert
move set_event_loop_policy deprecation notice to asyncio section
dc257ae
@graingert
Merge branch 'main' into deprecate-set-event-loop-policy
c60c92c
@graingert

graingert commented Nov 1, 2023

Copy link
Copy Markdown
Contributor Author

I have made the requested changes; please review again

willingc reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gvanrossum
gvanrossum approved these changes Nov 1, 2023
View reviewed changes

@gvanrossum gvanrossum left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but let's wait until the dust in the Discourse thread settles.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting changes labels Nov 1, 2023
@graingert
Merge branch 'main' into deprecate-set-event-loop-policy
d6b56ed
@seifertm seifertm mentioned this pull request Aug 11, 2024
Breaking change in 0.23.* pytest-dev/pytest-asyncio#706
Closed
@1st1

1st1 commented Sep 12, 2024

Copy link
Copy Markdown
Member

Happy to review and hopefully merge this during the core sprint.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugovk hugovk added the sprint label Sep 12, 2024
@asvetlov asvetlov added the topic-asyncio label Nov 12, 2024
@graingert graingert closed this Dec 25, 2024
@graingert
graingert deleted the deprecate-set-event-loop-policy branch December 25, 2024 08:05
@graingert

graingert commented Dec 25, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

@kumaraditya303 is doing this now in gh-127949

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cjw296 cjw296 cjw296 left review comments
@hugovk hugovk hugovk left review comments
@kumaraditya303 kumaraditya303 kumaraditya303 requested changes
@willingc willingc willingc approved these changes
@gvanrossum gvanrossum gvanrossum approved these changes
@vsajip vsajip Awaiting requested review from vsajip vsajip is a code owner
@1st1 1st1 Awaiting requested review from 1st1 1st1 is a code owner
@asvetlov asvetlov Awaiting requested review from asvetlov asvetlov is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting merge sprint topic-asyncio

Projects

Sprint
Archived in project

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@graingert @hugovk @kumaraditya303 @1st1 @cjw296 @willingc @gvanrossum @asvetlov
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.