Skip to content

Enable pyupgrade#3

Merged
mdavidbennett merged 1 commit into
linode:mainfrom
mdavidbennett:enable-pyupgrade
Jun 15, 2026
Merged

Enable pyupgrade#3
mdavidbennett merged 1 commit into
linode:mainfrom
mdavidbennett:enable-pyupgrade

Conversation

@mdavidbennett

Copy link
Copy Markdown
Contributor

This enables pyupgrade and applies all the changes it suggested. I also removed the unused MetricTypes type from metrics.py.

This enabled pyupgrade and applies all the changes it suggested. I also
removed the unused `MetricTypes` type from `metrics.py`.

Copilot AI left a comment

Copy link
Copy Markdown

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 enables Ruff’s pyupgrade (UP) ruleset and applies the resulting automated modernizations across the Python codebase, plus removes an unused metrics type alias.

Changes:

  • Enable UP in pyproject.toml and apply Python 3.10+ typing/stdlib updates (PEP 604 unions, built-in generics, collections.abc imports).
  • Update type annotations across models, stores, solvers, state managers, CLI, and utilities to match pyupgrade output.
  • Remove unused MetricTypes alias from metrics.py.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/certwrangler/utils.py Switch Optional/List annotations to `
src/certwrangler/types.py Replace Union/Dict usage with `
src/certwrangler/stores/vault.py Modernize Pydantic model field annotations and dict types.
src/certwrangler/stores/local.py Modernize union type annotation for _get_digest.
src/certwrangler/state_managers/local.py Modernize dict/list/union annotations across state manager helpers and methods.
src/certwrangler/state_managers/dummy.py Modernize annotations to built-in generics and `
src/certwrangler/solvers/lexicon.py Update provider options and config typing to dict[...].
src/certwrangler/solvers/edgedns.py Update request/response typing to dict[...] and `
src/certwrangler/shell.py Update Click validator and dev shell annotations to built-in generics.
src/certwrangler/schema_migrations.py Move Callable import to collections.abc and modernize migration typing.
src/certwrangler/models.py Broad annotation modernization across core models/state management.
src/certwrangler/metrics.py Remove unused MetricTypes and modernize callable/dict typing.
src/certwrangler/dns.py Update DNS record list/tuple typing to built-in generics.
src/certwrangler/daemon.py Modernize ThreadWithContext annotations and thread list typing.
src/certwrangler/controllers.py Modernize client and list/tuple/union annotations.
pyproject.toml Enable Ruff UP (pyupgrade) rules.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/certwrangler/daemon.py
Comment thread src/certwrangler/shell.py
@mdavidbennett
mdavidbennett merged commit e47c16d into linode:main Jun 15, 2026
9 checks passed
@mdavidbennett
mdavidbennett deleted the enable-pyupgrade branch June 15, 2026 19:42
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.

3 participants