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

restore uvloop.new_event_loop and other missing uvloop members to typing #573

Merged

Conversation

graingert
Copy link
Contributor

No description provided.

uvloop/__init__.pyi Outdated Show resolved Hide resolved
@graingert graingert force-pushed the uvloop-missing-nel-install-elp-etc branch from e08494f to 83fbb49 Compare October 14, 2023 11:21
Copy link
Contributor Author

Choose a reason for hiding this comment

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

adding this file removed the useful members like 'new_event_loop' which is needed for asyncio.Runner(...)

uvloop/__init__.py Outdated Show resolved Hide resolved
uvloop/__init__.py Outdated Show resolved Hide resolved
@graingert graingert force-pushed the uvloop-missing-nel-install-elp-etc branch 2 times, most recently from 0370a92 to ec9c6ce Compare October 14, 2023 11:40
@graingert graingert changed the title add missing uvloop members to uvloop/__init__.pyi restore uvloop.new_event_loop and other missing uvloop members to typing Oct 14, 2023
uvloop/__init__.py Outdated Show resolved Hide resolved
uvloop/__init__.py Outdated Show resolved Hide resolved
@graingert graingert force-pushed the uvloop-missing-nel-install-elp-etc branch from d887fa4 to 7ea847c Compare October 14, 2023 11:55
@graingert graingert marked this pull request as ready for review October 14, 2023 12:18
@graingert
Copy link
Contributor Author

@fantix can I get a review on this please? It's blocking mypy in unicorn

loop.set_debug(debug)
return loop.run_until_complete(wrapper())
finally:
if _typing.TYPE_CHECKING:
Copy link
Member

Choose a reason for hiding this comment

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

Can we just inline the typing and omit this TYPE_CHECKING check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried that, if you see the history of the PR, but it took too many changes

Copy link
Member

Choose a reason for hiding this comment

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

I see now. What about adding new_event_loop to __init__.pyi?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried that first also and it means the other members aren't type checked

loop.set_debug(debug)
return loop.run_until_complete(wrapper())
finally:
if _typing.TYPE_CHECKING:
Copy link
Member

Choose a reason for hiding this comment

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

I see now. What about adding new_event_loop to __init__.pyi?

@fantix fantix merged commit 5c500ee into MagicStack:master Oct 15, 2023
13 checks passed
@graingert graingert deleted the uvloop-missing-nel-install-elp-etc branch October 15, 2023 17:11
fantix added a commit that referenced this pull request Oct 22, 2023
Changes
=======

* Drop support of Python 3.7 and update CI (#578)
  (by @fantix in ee5ad26 for #578)

Fixes
=====

* Restore uvloop.new_event_loop and other missing uvloop members to typing (#573)
  (by @graingert in 5c500ee for #573)

* Fix docstring of loop.shutdown_default_executor (#535)
  (by @Gelbpunkt in 919da56 for #535)

* Fix CI status badge (#522)
  (by @shuuji3 in 0e9ff6c for #522)
@fantix fantix mentioned this pull request Oct 22, 2023
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

2 participants