-
Notifications
You must be signed in to change notification settings - Fork 7
Upgrade ty and cleanup rules #706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe changes update the CI/CD configuration and dependency management. The workflow CI file modifies the UV synchronization command in the Python linting step to use broader scope parameters. The project configuration file upgrades the Pre-merge checks✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying infrahub-sdk-python with
|
| Latest commit: |
64ca67a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://00f21b47.infrahub-sdk-python.pages.dev |
| Branch Preview URL: | https://pog-upgrade-ty-with-cleanup.infrahub-sdk-python.pages.dev |
45e9232 to
64ca67a
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## infrahub-develop #706 +/- ##
=================================================
Coverage 76.28% 76.28%
=================================================
Files 114 114
Lines 9830 9830
Branches 1508 1508
=================================================
Hits 7499 7499
Misses 1837 1837
Partials 494 494
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)
89-89: Consider reverting to--group lintfor efficiency.The change from
--group lintto--all-groups --all-extrasinstalls all dependency groups (tests, dev, types, etc.) when only linting tools are needed. This increases CI time and resource usage without apparent benefit, as the subsequent linting steps only useruffandtyfrom the lint group.🔎 Proposed fix to restore targeted dependency installation
- run: uv sync --all-groups --all-extras + run: uv sync --group lint
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (2)
.github/workflows/ci.ymlpyproject.toml
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: opsmill/infrahub-sdk-python PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-10T17:13:08.136Z
Learning: Run `uv run invoke format lint` before committing Python code
📚 Learning: 2025-12-10T17:13:08.136Z
Learnt from: CR
Repo: opsmill/infrahub-sdk-python PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-10T17:13:08.136Z
Learning: Run `uv run invoke format lint` before committing Python code
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-10T17:13:08.136Z
Learnt from: CR
Repo: opsmill/infrahub-sdk-python PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-10T17:13:08.136Z
Learning: Applies to **/*.py : Never bypass type checking without justification
Applied to files:
pyproject.toml
🔇 Additional comments (1)
pyproject.toml (1)
85-85: No action needed for this upgrade.The upgrade from
ty==0.0.4toty==0.0.5is a minor patch released 4 days later (December 16 to December 20, 2025) that focuses on performance improvements for TypedDict checking, not breaking changes. Both versions are in Beta status with no reported compatibility issues between them.
| [[tool.ty.overrides]] | ||
| include = ["infrahub_sdk/ctl/config.py"] | ||
|
|
||
| [tool.ty.overrides.rules] | ||
| unresolved-import = "ignore" # import tomli as tomllib when running on later versions of Python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
cat -n infrahub_sdk/ctl/config.py | head -40Repository: opsmill/infrahub-sdk-python
Length of output: 1468
Clarify the misleading comment in the unresolved-import override.
The comment states "import tomli as tomllib when running on later versions of Python," but this is backwards. tomllib is available in Python 3.11+, and tomli is needed for earlier versions. Update the comment to reflect: # tomli needed for Python < 3.11. The unresolved-import bypass itself is justified since the code uses the standard version-check pattern and type checkers have documented limitations with conditional imports.
🤖 Prompt for AI Agents
In pyproject.toml around lines 141 to 145, the inline comment on the
unresolved-import override is misleading; change the comment to state that tomli
is needed for Python < 3.11 (e.g. "# tomli needed for Python < 3.11") to
accurately reflect that tomllib is the stdlib in Python 3.11+ and tomli is used
on earlier versions, leaving the override itself unchanged.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.