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

Fix asyncio.get_running_loop() monkey-patching (#83) #99

Merged
merged 4 commits into from Jan 7, 2021

Conversation

niklasf
Copy link
Contributor

@niklasf niklasf commented Jan 5, 2021

Since Python 3.7 asyncio.get_running_loop() is public, so we will have to monkey-patch that in addition to the already monkey-patched internal asyncio.events.get_running_loop().

Part of #83.

@niklasf niklasf changed the title Test asyncio.get_running_loop() Fix asyncio.get_running_loop() monkey-patching (#83) Jan 5, 2021
@niklasf niklasf marked this pull request as ready for review January 5, 2021 18:04
@oremanj
Copy link
Member

oremanj commented Jan 6, 2021

Looks good. Please add newsfragments/99.bugfix.rst describing the user-visible impact of this change, e.g., "asyncio.get_running_loop() now knows how to return the running trio-asyncio event loop."

@oremanj oremanj mentioned this pull request Jan 6, 2021
13 tasks
@niklasf
Copy link
Contributor Author

niklasf commented Jan 6, 2021

News fragment added 👍

@codecov
Copy link

codecov bot commented Jan 6, 2021

Codecov Report

Merging #99 (ebf62ac) into master (9451387) will decrease coverage by 0.13%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #99      +/-   ##
==========================================
- Coverage   80.61%   80.48%   -0.14%     
==========================================
  Files          11       11              
  Lines        1238     1240       +2     
  Branches      172      172              
==========================================
  Hits          998      998              
- Misses        170      171       +1     
- Partials       70       71       +1     
Impacted Files Coverage Δ
trio_asyncio/_loop.py 78.69% <100.00%> (+0.18%) ⬆️
trio_asyncio/_base.py 84.23% <0.00%> (-0.55%) ⬇️

@shamrin
Copy link
Contributor

shamrin commented Jan 6, 2021

I've tried rerunning the checks a few times, but at least one macOS test hangs due to GitHub Actions bug. Every time a different macOS hangs. For this reason I can't merge this PR :(

@oremanj could you please mark all macOS tests as non-required?

@@ -0,0 +1,2 @@
:func:`asyncio.get_running_loop()` will now return the trio-asyncio event loop
Copy link
Member

Choose a reason for hiding this comment

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

I believe :func: wants its referent to be specified without the trailing parens. This made me realize we aren't testing newsfragments as part of the docs build. I created #102 to fix.

Copy link
Member

Choose a reason for hiding this comment

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

Never mind, it appears to work either way!

@oremanj oremanj merged commit b93c320 into python-trio:master Jan 7, 2021
@trio-bot
Copy link

trio-bot bot commented Jan 7, 2021

Hey @niklasf, it looks like that was the first time we merged one of your PRs! Thanks so much! 🎉 🎂

If you want to keep contributing, we'd love to have you. So, I just sent you an invitation to join the python-trio organization on Github! If you accept, then here's what will happen:

  • Github will automatically subscribe you to notifications on all our repositories. (But you can unsubscribe again if you don't want the spam.)

  • You'll be able to help us manage issues (add labels, close them, etc.)

  • You'll be able to review and merge other people's pull requests

  • You'll get a [member] badge next to your name when participating in the Trio repos, and you'll have the option of adding your name to our member's page and putting our icon on your Github profile (details)

If you want to read more, here's the relevant section in our contributing guide.

Alternatively, you're free to decline or ignore the invitation. You'll still be able to contribute as much or as little as you like, and I won't hassle you about joining again. But if you ever change your mind, just let us know and we'll send another invitation. We'd love to have you, but more importantly we want you to do whatever's best for you.

If you have any questions, well... I am just a humble Python script, so I probably can't help. But please do post a comment here, or in our chat, or on our forum, whatever's easiest, and someone will help you out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants