chore(no-ticket): bump pyupgrade to v3.21.2 and apply fixes#291
Merged
Conversation
…iles under the new pyupgrade ruleset. No behavior change.
Contributor
There was a problem hiding this comment.
Pull request overview
- Updates the repo’s pre-commit
pyupgradehook to target the project’s minimum supported Python (3.10+) and applies the resulting automated rewrites across the codebase.
Changes:
- Bump
pyupgradefromv3.19.1tov3.21.2and add--py310-plusin.pre-commit-config.yaml. - Apply
pyupgrade-driven modernizations (PEP 604 unions, built-in generics, f-strings,collections.abcimports) across the touched Python modules.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
.pre-commit-config.yaml |
Bumps pyupgrade and configures --py310-plus for Python 3.10+ rewrites. |
.github/.platforms/generate_platforms.py |
Updates typing imports to collections.abc where applicable. |
cloudsmith_cli/cli/commands/mcp.py |
Switches type hints to built-in generics (dict, list) in MCP CLI output helpers. |
cloudsmith_cli/cli/saml.py |
Replaces some .format(...) usage with f-strings. |
cloudsmith_cli/core/api/init.py |
Modernizes typing from Type[T] to type[T]. |
cloudsmith_cli/core/api/metadata.py |
Rewrites Optional/Union annotations to PEP 604 unions. |
cloudsmith_cli/core/download.py |
Modernizes typing annotations to PEP 604 unions and built-in generics. |
cloudsmith_cli/core/mcp/data.py |
Updates OpenAPI tool dataclass annotations to built-in generics and PEP 604 unions. |
cloudsmith_cli/core/mcp/server.py |
Updates schema/tool typing to built-in generics and PEP 604 unions. |
cloudsmith_cli/core/pagination.py |
Updates pagination typing to built-in generics and collections.abc. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cloudsmith-iduffy
approved these changes
May 11, 2026
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.
Bumps
pyupgradepre-commit hook fromv3.19.1tov3.21.2and adds the--py310-plusarg so the rewrite targets the project's minimum supported Python. Applies the resulting reformat across the tree.No behavior change — every diff in this PR is what
pre-commit run -a pyupgradeproduces on top of the version bump.Type of Change
Additional Notes
What changed
.pre-commit-config.yaml—pyupgraderevv3.19.1→v3.21.2, addargs: [--py310-plus], fix indentation of the hook block.Optional[X]→X | None, etc.):.github/.platforms/generate_platforms.pycloudsmith_cli/cli/commands/mcp.pycloudsmith_cli/cli/saml.pycloudsmith_cli/core/api/init.pycloudsmith_cli/core/api/metadata.pycloudsmith_cli/core/download.pycloudsmith_cli/core/mcp/data.pycloudsmith_cli/core/mcp/server.pycloudsmith_cli/core/pagination.pyVerification
pre-commit run -aclean.pytestgreen.