Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
with:
version: "${{ needs.prepare-environment.outputs.UV_VERSION }}"
- name: Install dependencies
run: uv sync --group lint
run: uv sync --all-groups --all-extras
- name: "Linting: ruff check"
run: "uv run ruff check ."
- name: "Linting: ruff format"
Expand Down
18 changes: 7 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ lint = [
"mypy==1.11.2",
"ruff==0.14.5",
"astroid>=3.1,<4.0",
"ty==0.0.4",
"ty==0.0.5",
]
types = [
"types-ujson",
Expand Down Expand Up @@ -130,23 +130,20 @@ include = ["infrahub_sdk/**"]
# The ignored rules below should be removed once the code has been updated, they are included #
# like this so that we can reactivate them one by one. #
##################################################################################################
division-by-zero = "ignore"
invalid-argument-type = "ignore"
invalid-assignment = "ignore"
invalid-await = "ignore"
invalid-return-type = "ignore"
invalid-type-form = "ignore"
missing-argument = "ignore"
no-matching-overload = "ignore"
possibly-unresolved-reference = "ignore"
redundant-cast = "ignore"
too-many-positional-arguments = "ignore"
type-assertion-failure = "ignore"
unknown-argument = "ignore"
unresolved-attribute = "ignore"
unresolved-import = "ignore"
unsupported-operator = "ignore"

[[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
Comment on lines +141 to +145
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

cat -n infrahub_sdk/ctl/config.py | head -40

Repository: 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.



[[tool.ty.overrides]]
include = ["tests/**"]
Expand All @@ -165,7 +162,6 @@ non-subscriptable = "ignore"
not-iterable = "ignore"
possibly-missing-attribute = "ignore"
unresolved-attribute = "ignore"
unresolved-import = "ignore"


[[tool.ty.overrides]]
Expand Down
46 changes: 23 additions & 23 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.