Skip to content

Conversation

@kurtmckee
Copy link
Contributor

This introduces pyupgrade as a pre-commit hook, then runs pre-commit run -a and commits the changes introduced.

The changes involve one of these two categories of changes:

  • typing.X is a deprecated alias for collections.abc.X
  • Type annotations no longer require Dict/List/etc, and can be replaced with dict/list/etc.

@auvipy auvipy requested review from auvipy and Copilot and removed request for auvipy October 22, 2025 16:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces pyupgrade as a pre-commit hook to modernize Python code by automatically converting deprecated typing aliases to their current equivalents. The changes update type annotations to use built-in types (dict, list) instead of typing module equivalents (Dict, List) and move Container and Iterator from typing to collections.abc.

  • Adds pyupgrade (v3.20.0) configured for Python 3.9+ to pre-commit hooks
  • Converts deprecated typing aliases to modern equivalents across the codebase
  • Updates CHANGELOG.rst to document this development improvement

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.pre-commit-config.yaml Adds pyupgrade hook with Python 3.9+ configuration
jwt/types.py Removes Dict import and uses dict for type annotation
jwt/jwks_client.py Converts Optional[T] to T | None, Dict to dict, List to list
jwt/help.py Removes Dict import and uses dict for nested type annotations
jwt/api_jwt.py Moves Container from typing to collections.abc
jwt/api_jwk.py Moves Iterator from typing to collections.abc
CHANGELOG.rst Documents the addition of pyupgrade pre-commit hook

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@kurtmckee kurtmckee force-pushed the introduce-pyupgrade branch from a7bb0d0 to 7a87dca Compare October 23, 2025 13:41
@kurtmckee
Copy link
Contributor Author

Rebased on master and resolved merge conflicts.

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.

1 participant