Add parameter and return type hints to kde/theme/build.py, kde/spectacle/apply.py and kde/fastfetch/build.py.
Add Color and ColorFn aliases in kde/theme/build.py using the Python 3.12 type statement.
Annotate variables mypy cannot infer, such as seen, chain, path, colors, families, pins and shortcuts.
Add # type: ignore[method-assign,assignment] to the optionxform = str lines, which mypy --strict rejects.
Target Python 3.12 or newer, the lowest version shipped by Fedora 40, Kubuntu 25.04 and Arch. No from __future__ import annotations is needed.
No runtime behavior changes.
Testing
mypy --strict on Python 3.12 reports no issues for all three scripts.
kde/theme/build.py run with Python 3.12 leaves the committed output files unchanged.
kde/spectacle/apply.py: Not run, because it needs a live KDE session.
kde/fastfetch/build.py: Not run, because it needs vipsthumbnail.
## Summary
- Add parameter and return type hints to `kde/theme/build.py`, `kde/spectacle/apply.py` and `kde/fastfetch/build.py`.
- Add `Color` and `ColorFn` aliases in `kde/theme/build.py` using the Python 3.12 `type` statement.
- Annotate variables mypy cannot infer, such as `seen`, `chain`, `path`, `colors`, `families`, `pins` and `shortcuts`.
- Add `# type: ignore[method-assign,assignment]` to the `optionxform = str` lines, which `mypy --strict` rejects.
- Target Python 3.12 or newer, the lowest version shipped by Fedora 40, Kubuntu 25.04 and Arch. No `from __future__ import annotations` is needed.
- No runtime behavior changes.
## Testing
- `mypy --strict` on Python 3.12 reports no issues for all three scripts.
- `kde/theme/build.py` run with Python 3.12 leaves the committed output files unchanged.
- `kde/spectacle/apply.py`: Not run, because it needs a live KDE session.
- `kde/fastfetch/build.py`: Not run, because it needs `vipsthumbnail`.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
kde/theme/build.py,kde/spectacle/apply.pyandkde/fastfetch/build.py.ColorandColorFnaliases inkde/theme/build.pyusing the Python 3.12typestatement.seen,chain,path,colors,families,pinsandshortcuts.# type: ignore[method-assign,assignment]to theoptionxform = strlines, whichmypy --strictrejects.from __future__ import annotationsis needed.Testing
mypy --stricton Python 3.12 reports no issues for all three scripts.kde/theme/build.pyrun with Python 3.12 leaves the committed output files unchanged.kde/spectacle/apply.py: Not run, because it needs a live KDE session.kde/fastfetch/build.py: Not run, because it needsvipsthumbnail.