Skip to content

Fix tests on 3.8/3.9 with latest typing_extensions#366

Merged
agronholm merged 11 commits intoagronholm:masterfrom
AlexWaygood:literal-failures
Jun 12, 2023
Merged

Fix tests on 3.8/3.9 with latest typing_extensions#366
agronholm merged 11 commits intoagronholm:masterfrom
AlexWaygood:literal-failures

Conversation

@AlexWaygood
Copy link
Copy Markdown
Contributor

Fixes #363
Fixes the CI failures seen in #365

typing_extensions>=4.6.0 reimplements typing.Literal on all Python versions <3.10.1, in order to backport various bugfixes that were requested by the community. This breaks some assumptions that typeguard currently makes.

Comment thread src/typeguard/_checkers.py Outdated
@coveralls
Copy link
Copy Markdown

coveralls commented Jun 2, 2023

Coverage Status

coverage: 96.68% (-0.1%) from 96.783% when pulling f86dbe0 on AlexWaygood:literal-failures into d1b9398 on agronholm:master.

@AlexWaygood
Copy link
Copy Markdown
Contributor Author

AlexWaygood commented Jun 2, 2023

Hmm, I see typing_extensions is currently only a dependency of typeguard on Python <3.11. The approach I'm taking in this PR will be simpler if you can assume that typing_extensions is always installed. Would you be open to changing the dependencies so that typing_extensions is a dependency on all Python versions?

@AlexWaygood AlexWaygood marked this pull request as ready for review June 2, 2023 11:23
@AlexWaygood
Copy link
Copy Markdown
Contributor Author

FYI, we are taking steps at typing_extensions to try to ensure that we break fewer third-party users in the future. We will be using pre-releases in the future, and have introduced a workflow that runs the test suites of various third-party projects on a nightly basis.

Comment thread src/typeguard/_checkers.py Outdated
Comment thread src/typeguard/_checkers.py Outdated
Comment thread src/typeguard/_checkers.py Outdated
Comment thread src/typeguard/_checkers.py Outdated
@AlexWaygood AlexWaygood requested a review from agronholm June 4, 2023 14:02
Comment thread src/typeguard/_checkers.py
@agronholm
Copy link
Copy Markdown
Owner

I'll take a look at your changes tomorrow.

Comment thread src/typeguard/_checkers.py Outdated
Comment thread src/typeguard/_checkers.py Outdated
Comment thread src/typeguard/_checkers.py
@agronholm agronholm merged commit 17c0f27 into agronholm:master Jun 12, 2023
@agronholm
Copy link
Copy Markdown
Owner

Thanks! Took me a while longer to review than I hoped, but here we are.

@AlexWaygood AlexWaygood deleted the literal-failures branch June 12, 2023 15:17
@AlexWaygood
Copy link
Copy Markdown
Contributor Author

Thanks! Took me a while longer to review than I hoped, but here we are.

No worries at all — thanks for the review!

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.

Literal checking discrepancy between typing vs typing-extensions 3.9

3 participants