Skip to content

Commit 40a9c61

Browse files
authored
[None][fix] generate nanobind stubs for submodules (#8539)
Signed-off-by: ixlmar <[email protected]>
1 parent f81caf5 commit 40a9c61

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

scripts/build_wheel.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,9 @@ def generate_python_stubs_linux(binding_type: str, venv_python: Path,
387387

388388
try:
389389
if is_nanobind:
390-
build_run(f"\"{venv_python}\" -m nanobind.stubgen -m bindings -O .",
391-
env=env_stub_gen)
390+
build_run(
391+
f"\"{venv_python}\" -m nanobind.stubgen -m bindings -r -O .",
392+
env=env_stub_gen)
392393
else:
393394
build_run(
394395
f"\"{venv_python}\" -m pybind11_stubgen -o . bindings --exit-code",
@@ -575,9 +576,9 @@ def get_binding_type_from_cache():
575576
nanobind_dir = build_dir / "tensorrt_llm" / "nanobind"
576577
if nanobind_dir.exists():
577578
rmtree(nanobind_dir)
578-
nanobind_stub_file = project_dir / "tensorrt_llm" / "bindings.pyi"
579-
if nanobind_stub_file.exists():
580-
nanobind_stub_file.unlink()
579+
nanobind_stub_dir = project_dir / "tensorrt_llm" / "bindings"
580+
if nanobind_stub_dir.exists():
581+
rmtree(nanobind_stub_dir)
581582

582583
pybind_dir = build_dir / "tensorrt_llm" / "pybind"
583584
if pybind_dir.exists():

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ def extract_url(line):
5050

5151
def sanity_check():
5252
tensorrt_llm_path = Path(__file__).resolve().parent / "tensorrt_llm"
53-
if not ((tensorrt_llm_path / "bindings").exists() or
54-
(tensorrt_llm_path / "bindings.pyi").exists()):
53+
if not (tensorrt_llm_path / "bindings").exists():
5554
raise ImportError(
5655
'The `bindings` module does not exist. Please check the package integrity. '
5756
'If you are attempting to use the pip development mode (editable installation), '

0 commit comments

Comments
 (0)