chore: introduce ty for type checking (non-blocking)#366
Conversation
- Add ty>=0.0.51 to dev dependencies - Add [tool.ty.rules] placeholder in root pyproject.toml - Remove dead [tool.mypy] block from hugegraph-llm/pyproject.toml - Add ty check step to ruff.yml with continue-on-error: true Errors are reported in CI but do not fail the build during ramp-up. Scope: hugegraph-llm/src and hugegraph-python-client/src only. Closes apache#364
imbajin
left a comment
There was a problem hiding this comment.
Blocking: no. Summary: The new non-blocking ty check currently runs without the runtime extras needed by the checked packages. Evidence: after uv sync --extra dev, uv run ty check hugegraph-llm/src hugegraph-python-client/src reports 838 diagnostics starting with unresolved fastapi, pydantic, and dotenv.
…type check - uv sync --extra dev --extra llm --extra python-client so ty can resolve fastapi, pydantic, dotenv etc. when checking hugegraph-llm/src and hugegraph-python-client/src - add ty>=0.0.51 to dev dependencies
There was a problem hiding this comment.
Blocking: no. Summary: No obvious issues found in the current head. Evidence: git diff --check passed; uv sync --extra dev --extra llm --extra python-client succeeded; non-blocking ty check executed and reported existing diagnostics.
Follow-up: please keep reducing the reported ty diagnostics incrementally. This PR is fine as a non-blocking signal rollout, but the current ty output should not become permanent CI noise; the goal should be to eventually make it clean enough to enforce.
VGalaxies
left a comment
There was a problem hiding this comment.
Review summary
- Blocking: yes
- Summary: The Python 3.12 Ruff matrix job now installs
hugegraph-llm, which excludes Python 3.12, so CI can fail before the non-blockingtystep runs. - Evidence:
git diff origin/main...HEADnl -ba .github/workflows/ruff.ymlnl -ba hugegraph-llm/pyproject.toml
…3.12 dep conflict hugegraph-llm requires Python >=3.10,<3.12, so running 'uv sync --extra dev --extra llm --extra python-client' on the 3.12 build matrix entry causes dep resolution failure before the non-blocking ty step can apply. Split into: - build job (3.10/3.11/3.12): only ruff format+lint, uv sync --extra dev - ty-check job (3.10/3.11 only): installs llm+client extras, runs ty check with continue-on-error: true at job level
…reen in PR checks
imbajin
left a comment
There was a problem hiding this comment.
Blocking: no. Summary: No obvious issues found in the current head. Evidence: git diff --check refs/remotes/apache/main...refs/remotes/pr/366 passed; latest-head GitHub checks completed successfully.
Closes apache#364 ## What Introduces `ty` (Astral's Rust-based type checker) to the project in non-blocking mode as the first step of a gradual adoption plan. ## Changes - **`pyproject.toml`** — add `ty>=0.0.51` to `dev` optional dependencies; add `[tool.ty.rules]` placeholder section - **`hugegraph-llm/pyproject.toml`** — remove the `[tool.mypy]` block (its three settings are either unsupported or default behavior in ty) - **`.github/workflows/ruff.yml`** — add `ty check` step with `continue-on-error: true` so errors are reported but do not fail CI during ramp-up
Closes #364
What
Introduces
ty(Astral's Rust-based type checker) to the project in non-blocking mode as the first step of a gradual adoption plan.Changes
pyproject.toml— addty>=0.0.51todevoptional dependencies; add[tool.ty.rules]placeholder sectionhugegraph-llm/pyproject.toml— remove the[tool.mypy]block (its three settings are either unsupported or default behavior in ty).github/workflows/ruff.yml— addty checkstep withcontinue-on-error: trueso errors are reported but do not fail CI during ramp-upWhy non-blocking
tyruns on every PR and surfaces type errors in the CI log, butcontinue-on-error: truekeeps the build green. Once errors are fixed incrementally (file by file in follow-up PRs),continue-on-error: truewill be removed to enforce the check.Scope
Covers
hugegraph-llm/srcandhugegraph-python-client/srconly.hugegraph-mlis deferred due to heavy optional deps (DGL, PyTorch).graph-mcpwill be added once the module is introduced.