Skip to content

Add typing_extensions dependency for Python < 3.11#1151

Merged
jpadilla merged 7 commits intomasterfrom
claude/fix-pyjwt-1150-apanu
Mar 13, 2026
Merged

Add typing_extensions dependency for Python < 3.11#1151
jpadilla merged 7 commits intomasterfrom
claude/fix-pyjwt-1150-apanu

Conversation

@jpadilla
Copy link
Copy Markdown
Owner

Summary

Add typing_extensions as a conditional dependency for Python versions below 3.11 to support type hints that are only available in newer Python versions.

Changes

  • Added typing_extensions >= 4.0 as a dependency for Python versions < 3.11
  • This ensures compatibility with type annotation features that were introduced in Python 3.11 while maintaining support for earlier Python versions (3.9+)

Details

The typing_extensions package 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

claude and others added 2 commits March 13, 2026 17:50
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
Comment thread .github/workflows/main.yml Fixed
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
@jpadilla jpadilla force-pushed the claude/fix-pyjwt-1150-apanu branch from c1fd360 to a469b56 Compare March 13, 2026 18:13
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
@jpadilla jpadilla force-pushed the claude/fix-pyjwt-1150-apanu branch from 421b3a9 to 6905cde Compare March 13, 2026 18:20
@jpadilla jpadilla linked an issue Mar 13, 2026 that may be closed by this pull request
@jpadilla jpadilla merged commit a4e1a3d into master Mar 13, 2026
35 checks passed
@jpadilla jpadilla deleted the claude/fix-pyjwt-1150-apanu branch March 13, 2026 18:41
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.

python<3.11: ModuleNotFoundError: No module named 'typing_extensions'

3 participants