fix(deps): update YAML import statements and add types-PyYAML to dev …#2761
Conversation
Greptile code reviewThis repo uses Greptile for automated review. Before merge, aim for Confidence Score: 5/5 with zero unresolved review threads — see CONTRIBUTING.md. Run a review — add a PR comment with: Give it ~5-10 minutes (sometimes longer) for results, then fix feedback and re-trigger until you reach Confidence Score: 5/5. Optional: automate with the greploop skill. |
Greptile SummaryThis PR adds
Confidence Score: 5/5Safe to merge — no logic changes, only type stub addition and suppression comment removal. All three changed files are straightforward: the lockfile correctly resolves the new stub package, pyproject.toml follows the existing types-psutil pattern exactly, and the config.py edits are purely cosmetic removals of now-unnecessary suppression comments with zero runtime impact. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[mypy type check] --> B{PyYAML stubs available?}
B -- "Before PR: No" --> C["# type: ignore[import-untyped] required"]
B -- "After PR: Yes (types-PyYAML)" --> D[Full type resolution of yaml.*]
D --> E[yaml.safe_load / yaml.safe_dump fully checked]
C --> F[yaml API misuse goes undetected]
Reviews (1): Last reviewed commit: "fix(deps): update YAML import statements..." | Re-trigger Greptile |
|
🎊 Achievement unlocked: PR Merged. @ApexYash11 passed code review, survived CI, and shipped. Respect. 🤝 👋 Join us on Discord - OpenSRE : hang out, contribute, or hunt for features and issues. Everyone's welcome. |

…dependencies
Fixes #
chore(deps): add types-PyYAML stubs and remove yaml type ignores (#2590)
Describe the changes you have made in this PR -
Added types-PyYAML>=6.0.12 to the [dependency-groups] dev list in pyproject.toml and removed three # type: ignore[import-untyped] comments from import yaml lines in app/cli/commands/config.py. With the stubs installed, mypy can now fully type-check all yaml usage without suppressions
Demo/Screenshot for feature changes and bug fixes -
Code Understanding and AI Usage
Did you use AI assistance (ChatGPT, Claude, Copilot, etc.) to write any part of this code?
If you used AI assistance:
Explain your implementation approach:
What problem does your code solve?
The project uses import yaml in three places (app/cli/commands/config.py), but PyYAML doesn't ship inline type annotations. This required # type: ignore[import-untyped] on every import, suppressing mypy checks and weakening type coverage. Any misuses of the yaml API (wrong arguments, wrong return types) would go undetected
What alternative approaches did you consider?
Why did you choose this specific implementation?
The types-PyYAML package from typeshed is the canonical solution — it's the same approach already used for types-psutil. It requires zero new code, zero behavioral changes, and is maintained by the community alongside CPython releases. Adding it to [dependency-groups] dev keeps it scoped to development (not runtime). The type: ignore comments were then removable in one clean sweep
What are the key functions/components and what do they do?
Checklist before requesting a review
Note: Please check Allow edits from maintainers if you would like us to assist in the PR.