Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add Python 3.12 beta to test matrix#3751

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Bibo-Joshi merged 26 commits intomasterfromadd-py-312
Jul 5, 2023
Merged

Add Python 3.12 beta to test matrix#3751

Bibo-Joshi merged 26 commits intomasterfromadd-py-312
Jul 5, 2023

Conversation

@harshil21
Copy link
Member

@harshil21harshil21 commentedJun 9, 2023
edited
Loading

To be merged after#3728

Things changed for us:

@harshil21harshil21 added 📋 do-not-merge-yetwork status: do-not-merge-yet 🔗 pythonrelated technology: python labelsJun 9, 2023
@harshil21
Copy link
MemberAuthor

harshil21 commentedJun 9, 2023
edited
Loading

defgen():yieldawaitasyncio.create_task(gen())

does not work in python 3.12. Changing into anasync def does not work either.

The3.12 changelog notes:

"asyncio.iscoroutine() now returns False for generators as asyncio does not support legacy generator-based coroutines."

Does this mean we should drop support for generators inapp.create_task too? Support for that was added in#3543 (comment).

Related code and PRs:

https://github.com/python/cpython/blob/main/Lib/asyncio/tasks.py#L106-L110
python/cpython#102749

harshil21and others added2 commitsJune 10, 2023 01:24
Also remove support for generators in app.create_task
@Bibo-Joshi
Copy link
Member

Does this mean we should drop support for generators in app.create_task too?

Not for py 3.11-, as that would be a breach of our stability policy. We can think about deprecating it, but dropping support unannounced is a no-go.
For 3.12+, to stay in line with our stability poclicy, we should try to still support it + add deprecation notices. If there is no feasible workaround, we ofc don't have a chance.

clot27and others added2 commitsJune 17, 2023 09:10
Co-authored-by: Aditya <clot27@apx_managed.vanilla>>
@harshil21
Copy link
MemberAuthor

@Bibo-Joshi okay, now how do I specify different type hints for thecoroutine parameter for different python versions? Should I just use aif sys.version_info.. : @overload def create_task(...) thingy?

and what kind of workaround do you suggest for py3.12+? I don't see any

@Bibo-Joshi
Copy link
Member

@Bibo-Joshi okay, now how do I specify different type hints for thecoroutine parameter for different python versions? Should I just use aif sys.version_info.. : @overload def create_task(...) thingy?

Sounds good if that works reasonably well. Don't know if it's possible to make only the overload part the content of the if clause or if you have to define the method twice

and what kind of workaround do you suggest for py3.12+? I don't see any

I don't have anything in mind TBH, haven't looked into it yet

Copy link
MemberAuthor

@harshil21harshil21 left a comment

Choose a reason for hiding this comment

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

I double checked by running mypy in different python versions, and also checked if VSCode shows a type error when passing an (async) generator toapp.create_task for py > 3.12.

Copy link

@github-actionsgithub-actionsbot left a comment

Choose a reason for hiding this comment

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

Hey! Looks like you edited the (optional) requirements or the pre-commit hooks. I'm just a friendly reminder to keep the additional dependencies for the hooks in sync with the requirements :)

@harshil21
Copy link
MemberAuthor

pre-commit.ci run

pre-commit-ci[bot] reacted with rocket emojiBibo-Joshi reacted with eyes emoji

Base automatically changed fromdrop-py-37 tomasterJune 29, 2023 16:17
@harshil21harshil21 changed the titleAdd Python 3.12 beta 2 to test matrixAdd Python 3.12 beta to test matrixJul 2, 2023
@harshil21harshil21 removed the 📋 do-not-merge-yetwork status: do-not-merge-yet labelJul 2, 2023
@Bibo-JoshiBibo-Joshi merged commit589047d intomasterJul 5, 2023
@Bibo-JoshiBibo-Joshi deleted the add-py-312 branchJuly 5, 2023 19:58
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJul 13, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@github-actionsgithub-actions[bot]github-actions[bot] left review comments

@Bibo-JoshiBibo-JoshiBibo-Joshi approved these changes

Assignees

No one assigned

Labels

🔗 pythonrelated technology: python

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

7 participants

@harshil21@Bibo-Joshi@Trifase@thefunkycat@clot27@lemontree210

[8]ページ先頭

©2009-2025 Movatter.jp