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 — Add Python 3.12 beta to test matrix by harshil21 · Pull Request #3751 · python-telegram-bot/python-telegram-bot

Conversation

@harshil21

@harshil21 harshil21 commented Jun 9, 2023 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

To be merged after #3728

Things changed for us:

  • Tests: Fix regex pattern match in test_picklepersistence: Remove new line in pickle error message python/cpython#31782
  • Tests: Slightly better formatted error message for missing abstractmethods. The test also now uses __abstractmethods__ to dynamically get all defined abstract methods.
  • app.create_task should not accept generators. See below post

Sorry, something went wrong.

Uh oh!

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

All reactions
Bibo-Joshi and others added 8 commits June 2, 2023 18:23
@Bibo-Joshi
Remove Python 3.7 from testing, docs and packaging
c7ea5fd
@Bibo-Joshi
Re-add note on CI bots
f1784b5
@harshil21
temporarily run tests on this branch
03d3c33
@Bibo-Joshi
Add missing new line
4de4643
@Trifase
Adopt Py3.8+ features: missing_ok Parameter (#3742)
457e4ef
@thefunkycat
Introduce Walrus Operator (#3749)
a1c2fe7
@harshil21
Add python 3.12 to test matrix
f663f37
@harshil21
correct typo
b49d03f
@harshil21 harshil21 added 📋 do-not-merge-yet work status: do-not-merge-yet 🔗 python related technology: python labels Jun 9, 2023
@harshil21
Remove Python 3.7 Workaround for PicklePersistence (#3740)
9d3345c
@harshil21

harshil21 commented Jun 9, 2023 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author
def gen():
    yield

await asyncio.create_task(gen())

does not work in python 3.12. Changing into an async def does not work either.

The 3.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 in app.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

All reactions

Sorry, something went wrong.

Uh oh!

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

harshil21 and others added 2 commits June 10, 2023 01:24
@harshil21
Fix tests on py 3.12
1a3e4f7
Also remove support for generators in app.create_task
@Bibo-Joshi
Merge branch 'master' into drop-py-37
8c86a34
@Bibo-Joshi

Bibo-Joshi commented Jun 13, 2023

Copy link
Copy Markdown
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.

All reactions

Sorry, something went wrong.

Uh oh!

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

clot27 and others added 2 commits June 17, 2023 09:10
@clot27 Aditya
Drop CancelledError (#3754)
cf71a38
Co-authored-by: Aditya <clot27@apx_managed.vanilla>
>
@Bibo-Joshi
Make use of @final, Final and Literal (#3753)
9181369
@harshil21

harshil21 commented Jun 19, 2023

Copy link
Copy Markdown
Member Author

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

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@lemontree210
fix error with Literal, causing tests/docs to fail (#3764)
27a8683
@Bibo-Joshi

Bibo-Joshi commented Jun 19, 2023

Copy link
Copy Markdown
Member

@Bibo-Joshi okay, now how do I specify different type hints for the coroutine parameter for different python versions? Should I just use a if 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

All reactions

Sorry, something went wrong.

Uh oh!

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

harshil21 added 2 commits June 20, 2023 19:39
@harshil21
Review: don't drop support for async gens for py < 3.12
b44e4af
@harshil21
Merge branch 'drop-py-37' into add-py-312
40c2cf3
harshil21
harshil21 commented Jun 20, 2023
View reviewed changes

@harshil21 harshil21 left a comment

Copy link
Copy Markdown
Member Author

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.

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

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread telegram/ext/_application.py Resolved

Uh oh!

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

Comment thread telegram/ext/_application.py Resolved

Uh oh!

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

Bibo-Joshi
Bibo-Joshi reviewed Jun 20, 2023
View reviewed changes
Comment thread telegram/ext/_application.py Resolved

Uh oh!

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

Comment thread telegram/ext/_application.py Resolved

Uh oh!

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

Comment thread telegram/ext/_application.py Resolved

Uh oh!

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

@harshil21
Bump mypy and address review
8234f3c
github-actions[bot]
github-actions Bot reviewed Jun 20, 2023
View reviewed changes

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

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.

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 :)

Sorry, something went wrong.

Uh oh!

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

All reactions
@harshil21

harshil21 commented Jun 21, 2023

Copy link
Copy Markdown
Member Author

pre-commit.ci run

pre-commit-ci[bot] reacted with rocket emoji Bibo-Joshi reacted with eyes emoji
All reactions
  • 🚀 1 reaction
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

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

Bibo-Joshi
Bibo-Joshi requested changes Jun 25, 2023
View reviewed changes
Comment thread telegram/ext/_application.py Resolved

Uh oh!

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

Comment thread telegram/ext/_application.py Resolved

Uh oh!

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

Base automatically changed from drop-py-37 to master June 29, 2023 16:17
@harshil21
Review: Add deprecation warning & modify type hints
162004f
harshil21 added 2 commits July 3, 2023 00:25
@harshil21
use 3.12 beta 3
8b73410
@harshil21
merge master and fix conflicts
4962c48
@harshil21 harshil21 changed the title Add Python 3.12 beta 2 to test matrix Add Python 3.12 beta to test matrix Jul 2, 2023
harshil21 added 4 commits July 3, 2023 00:41
@harshil21
try to fix type completeness CI check
9d0c980
@harshil21
fix a leftover merge conflict
e753dd7
@harshil21
bump mypy again
0755fe1
@harshil21
try bumping pyright
316e500
@harshil21 harshil21 removed the 📋 do-not-merge-yet work status: do-not-merge-yet label Jul 2, 2023
Bibo-Joshi
Bibo-Joshi reviewed Jul 4, 2023
View reviewed changes
Comment thread telegram/ext/_application.py Resolved

Uh oh!

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

@harshil21
review: fix pyright by applying 'RT' generic
69ef58b
Bibo-Joshi
Bibo-Joshi approved these changes Jul 4, 2023
View reviewed changes
@Bibo-Joshi
Merge branch 'master' into add-py-312
816f020
@Bibo-Joshi
Bibo-Joshi merged commit 589047d into master Jul 5, 2023
@Bibo-Joshi
Bibo-Joshi deleted the add-py-312 branch July 5, 2023 19:58
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@github-actions github-actions[bot] github-actions[bot] left review comments
@Bibo-Joshi Bibo-Joshi Bibo-Joshi approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

🔗 python related technology: python

Projects

None yet

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.

6 participants

@harshil21 @Bibo-Joshi @Trifase @thefunkycat @clot27 @lemontree210
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.