Enable pyupgrade#3
Merged
Merged
Conversation
This enabled pyupgrade and applies all the changes it suggested. I also removed the unused `MetricTypes` type from `metrics.py`.
There was a problem hiding this comment.
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
UPinpyproject.tomland apply Python 3.10+ typing/stdlib updates (PEP 604 unions, built-in generics,collections.abcimports). - Update type annotations across models, stores, solvers, state managers, CLI, and utilities to match
pyupgradeoutput. - Remove unused
MetricTypesalias frommetrics.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.
jfrederi-akamai
approved these changes
Jun 15, 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.
This enables pyupgrade and applies all the changes it suggested. I also removed the unused
MetricTypestype frommetrics.py.