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 tests on 3.8/3.9 with latest typing_extensions #366

Merged
merged 11 commits into from
Jun 12, 2023

Conversation

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

@coveralls
Copy link

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
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
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.

src/typeguard/_checkers.py Outdated Show resolved Hide resolved
src/typeguard/_checkers.py Outdated Show resolved Hide resolved
src/typeguard/_checkers.py Outdated Show resolved Hide resolved
src/typeguard/_checkers.py Outdated Show resolved Hide resolved
@agronholm
Copy link
Owner

I'll take a look at your changes tomorrow.

src/typeguard/_checkers.py Outdated Show resolved Hide resolved
src/typeguard/_checkers.py Outdated Show resolved Hide resolved
src/typeguard/_checkers.py Show resolved Hide resolved
@agronholm agronholm merged commit 17c0f27 into agronholm:master Jun 12, 2023
@agronholm
Copy link
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
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