Skip to content

chore(no-ticket): bump pyupgrade to v3.21.2 and apply fixes#291

Merged
BartoszBlizniak merged 1 commit into
masterfrom
chore/pre-commit-pyupgrade
May 11, 2026
Merged

chore(no-ticket): bump pyupgrade to v3.21.2 and apply fixes#291
BartoszBlizniak merged 1 commit into
masterfrom
chore/pre-commit-pyupgrade

Conversation

@BartoszBlizniak
Copy link
Copy Markdown
Member

@BartoszBlizniak BartoszBlizniak commented May 11, 2026

Bumps pyupgrade pre-commit hook from v3.19.1 to v3.21.2 and adds the --py310-plus arg 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 pyupgrade produces on top of the version bump.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactoring
  • Other (please describe): chore / tooling upgrade

Additional Notes

What changed

  • .pre-commit-config.yamlpyupgrade rev v3.19.1v3.21.2, add args: [--py310-plus], fix indentation of the hook block.
  • 9 source files reformatted by the upgraded hook (modernised string formatting, Optional[X]X | None, etc.):
    • .github/.platforms/generate_platforms.py
    • cloudsmith_cli/cli/commands/mcp.py
    • cloudsmith_cli/cli/saml.py
    • cloudsmith_cli/core/api/init.py
    • cloudsmith_cli/core/api/metadata.py
    • cloudsmith_cli/core/download.py
    • cloudsmith_cli/core/mcp/data.py
    • cloudsmith_cli/core/mcp/server.py
    • cloudsmith_cli/core/pagination.py

Verification

  • pre-commit run -a clean.
  • pytest green.

…iles under the new pyupgrade ruleset. No behavior change.
@BartoszBlizniak BartoszBlizniak marked this pull request as ready for review May 11, 2026 14:54
@BartoszBlizniak BartoszBlizniak requested a review from a team as a code owner May 11, 2026 14:54
Copilot AI review requested due to automatic review settings May 11, 2026 14:54
Copy link
Copy Markdown
Contributor

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

  • Updates the repo’s pre-commit pyupgrade hook to target the project’s minimum supported Python (3.10+) and applies the resulting automated rewrites across the codebase.

Changes:

  • Bump pyupgrade from v3.19.1 to v3.21.2 and add --py310-plus in .pre-commit-config.yaml.
  • Apply pyupgrade-driven modernizations (PEP 604 unions, built-in generics, f-strings, collections.abc imports) 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.

Comment thread cloudsmith_cli/core/pagination.py
Comment thread cloudsmith_cli/core/mcp/server.py
Comment thread cloudsmith_cli/core/mcp/server.py
@BartoszBlizniak BartoszBlizniak self-assigned this May 11, 2026
@BartoszBlizniak BartoszBlizniak merged commit fb308f4 into master May 11, 2026
44 checks passed
@BartoszBlizniak BartoszBlizniak deleted the chore/pre-commit-pyupgrade branch May 11, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants