Update nanobind to 2.15.0 - #4337
Conversation
|
With the updated stubs, a = mx.array(...)
b = a == a # correctly inferred as mx.array rather than bool | mx.array |
| - name: Check generated Python stubs with ty | ||
| if: matrix.os == 'Linux' && matrix.arch == 'x86_64' && matrix.toolkit == 'cpu' | ||
| continue-on-error: true | ||
| run: uvx ty check python/mlx/core |
There was a problem hiding this comment.
uv check seems to be ty now?
Since type checking passes now I would like to make it mandatory, I don't care about making every type checker happy and we can drop Ruff.
There was a problem hiding this comment.
uv check relies on the project metadata in pyproject.toml, it cannot be scoped to just the generated stubs I think. Running it at the repository root currently reports hundreds of diagnostics. A full Ruff check on the generated stubs also reports 150 errors
I dropped the Ruff step and made the targeted uvx ty check python/mlx/core check mandatory.
There was a problem hiding this comment.
That makes sense, thanks for fixing the type errors!
Proposed changes
Update nanobind from 2.13.0 to 2.15.0 for the MLX Python bindings and extension examples.
This change also:
__index__while rejecting floating-point and string inputsmlx.corestubs in the Linux CPU CI jobChecklist
Put an
xin the boxes that apply.pre-commit run --all-filesto format my code / installed pre-commit prior to committing changes