style: enable pyupgrade rules
Metadata
Current evaluation
Merged. Enables additional pyupgrade rules to modernize Python syntax across 33 files. Approved by two reviewers, passed all CI checks and linting, and integrated into the main branch.
Suggested action: —
No scores available.
Issue body
- [x] Have you followed the [guidelines for contributing](https://github.com/canonical/snapcraft/blob/main/CONTRIBUTING.md)?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] Have you successfully run `make lint`?
- [x] Have you successfully run `make test`?
---
This PR enables the rest of the [`pyupgrade`](https://docs.astral.sh/ruff/rules/#pyupgrade-up) rules. Compared to #5304, it enables more rules but has fewer changes to the code.
The first commit is machine-generated - I added the rule and did `make format && make lint`. The second commit is done by hand.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged. Enables additional pyupgrade rules to modernize Python syntax across 33 files. Approved by two reviewers, passed all CI checks and linting, and integrated into the main branch. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged changes enabling remaining pyupgrade rules for code style. Includes automated formatting and manual adjustments, passing lint and test checks. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged changes enabling additional pyupgrade linting rules. The first commit was auto-generated, the second manual. All lint and test checks passed. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #856 style: update mypy and fix linting issues | craft-application | merged | Merged after receiving approval from two reviewers and passing all CI checks. The update refreshed mypy and resolved linting issues across two files, resulting in 38 additions and 32 deletions. | |
| #479 style: drop mypy, pyright | craft-cli | merged | Merged after approval from two reviewers; replaces mypy and pyright with ty, passing all CI checks. The change removed 341 lines and added 17 across 8 files. | |
| #421 style: drop mypy, pyright | craft-store | merged | Merged after approval from two reviewers; all CI checks passed. Replaces mypy and pyright with ty, removing 413 lines and adding 27 across 13 files. | |
| #6034 style: fix mypy warnings | snapcraft | merged | Merged after approval from two reviewers. The changes resolve two mypy type-checking warnings by modifying a single file. All CI checks passed, and the fix was integrated into the main branch. | |
| #1312 style(ci): enable mypy | charmcraft | merged | Merged after two approvals. Enables mypy in CI, modifying 14 files (+70/-33). A related spread test fix was handled in a separate PR. |