mirror of
https://github.com/NVIDIA/TensorRT-LLM.git
synced 2026-01-13 22:18:36 +08:00
[None][fix] generate nanobind stubs for submodules (#8539)
Signed-off-by: ixlmar <206748156+ixlmar@users.noreply.github.com>
This commit is contained in:
parent
f81caf5491
commit
40a9c61a89
@ -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():
|
||||
|
||||
3
setup.py
3
setup.py
@ -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), '
|
||||
|
||||
Loading…
Reference in New Issue
Block a user