[None][fix] generate nanobind stubs for submodules (#8539)

Signed-off-by: ixlmar <206748156+ixlmar@users.noreply.github.com>
This commit is contained in:
mpikulski 2025-10-22 12:23:08 +02:00 committed by GitHub
parent f81caf5491
commit 40a9c61a89
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 7 deletions

View File

@ -387,8 +387,9 @@ def generate_python_stubs_linux(binding_type: str, venv_python: Path,
try:
if is_nanobind:
build_run(f"\"{venv_python}\" -m nanobind.stubgen -m bindings -O .",
env=env_stub_gen)
build_run(
f"\"{venv_python}\" -m nanobind.stubgen -m bindings -r -O .",
env=env_stub_gen)
else:
build_run(
f"\"{venv_python}\" -m pybind11_stubgen -o . bindings --exit-code",
@ -575,9 +576,9 @@ def main(*,
nanobind_dir = build_dir / "tensorrt_llm" / "nanobind"
if nanobind_dir.exists():
rmtree(nanobind_dir)
nanobind_stub_file = project_dir / "tensorrt_llm" / "bindings.pyi"
if nanobind_stub_file.exists():
nanobind_stub_file.unlink()
nanobind_stub_dir = project_dir / "tensorrt_llm" / "bindings"
if nanobind_stub_dir.exists():
rmtree(nanobind_stub_dir)
pybind_dir = build_dir / "tensorrt_llm" / "pybind"
if pybind_dir.exists():

View File

@ -50,8 +50,7 @@ def parse_requirements(filename: os.PathLike):
def sanity_check():
tensorrt_llm_path = Path(__file__).resolve().parent / "tensorrt_llm"
if not ((tensorrt_llm_path / "bindings").exists() or
(tensorrt_llm_path / "bindings.pyi").exists()):
if not (tensorrt_llm_path / "bindings").exists():
raise ImportError(
'The `bindings` module does not exist. Please check the package integrity. '
'If you are attempting to use the pip development mode (editable installation), '