Switch to nanobind (#839)

* mostly builds

* most tests pass

* fix circle build

* add back buffer protocol

* includes

* fix for py38

* limit to cpu device

* include

* fix stubs

* move signatures for docs

* stubgen + docs fix

* doc for compiled function, comments
This commit is contained in:
Awni Hannun
2024-03-18 20:12:25 -07:00
committed by GitHub
parent d39ed54f8e
commit 9a8ee00246
34 changed files with 2343 additions and 2344 deletions

View File

@@ -134,7 +134,9 @@ class GenerateStubs(Command):
pass
def run(self) -> None:
subprocess.run(["pybind11-stubgen", "mlx.core", "-o", "python"])
subprocess.run(
["python", "-m", "nanobind.stubgen", "-m", "mlx.core", "-r", "-O", "python"]
)
# Read the content of README.md
@@ -165,7 +167,7 @@ if __name__ == "__main__":
include_package_data=True,
extras_require={
"testing": ["numpy", "torch"],
"dev": ["pre-commit", "pybind11-stubgen"],
"dev": ["pre-commit"],
},
ext_modules=[CMakeExtension("mlx.core")],
cmdclass={"build_ext": CMakeBuild, "generate_stubs": GenerateStubs},