Add typing_extensions dependency for Python < 3.11#1151
Merged
Conversation
PyJWT imports typing_extensions.Never (Python < 3.11) and typing_extensions.TypeAlias (Python < 3.10) at runtime in jwt/algorithms.py, but typing_extensions was never declared as a dependency. This causes a ModuleNotFoundError on Python 3.9/3.10 when importing the library. Fixes #1150 https://claude.ai/code/session_013ZvbKEyVkcUx8xHrqt8v2F
The existing install-dev job always installs with [dev] extras, which bundles cryptography and pulls in typing_extensions transitively via test tooling. This masked the missing typing_extensions dependency (#1150). Add an install-minimal job that tests bare `pip install .` and `pip install .[crypto]` on Python 3.9 and 3.13, ensuring undeclared runtime dependencies are caught immediately. https://claude.ai/code/session_013ZvbKEyVkcUx8xHrqt8v2F
c1fd360 to
a469b56
Compare
Consolidate into a single job that tests progressively: bare install, crypto extra, then dev extras. Tests Python 3.9 and 3.13 to cover both the typing_extensions fallback and native typing paths. https://claude.ai/code/session_013ZvbKEyVkcUx8xHrqt8v2F
421b3a9 to
6905cde
Compare
Restrict GITHUB_TOKEN to read-only contents access, as flagged by github-advanced-security[bot]. https://claude.ai/code/session_013ZvbKEyVkcUx8xHrqt8v2F
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Add
typing_extensionsas a conditional dependency for Python versions below 3.11 to support type hints that are only available in newer Python versions.Changes
typing_extensions >= 4.0as a dependency for Python versions < 3.11Details
The
typing_extensionspackage provides backports of typing features from newer Python versions, allowing the codebase to use modern type hints across all supported Python versions (3.9+).https://claude.ai/code/session_013ZvbKEyVkcUx8xHrqt8v2F