Skip to content

Commit f0589db

Browse files
committed
[https://nvbugs/5628848][fix] Fix nanobind stub generation
Signed-off-by: Linda-Stadter <57756729+Linda-Stadter@users.noreply.github.com>
1 parent b130d58 commit f0589db

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

scripts/build_wheel.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,13 @@ def generate_python_stubs_linux(binding_type: str, venv_python: Path,
395395
try:
396396
if is_nanobind:
397397
build_run(
398-
f"\"{venv_python}\" -m nanobind.stubgen -m bindings -r -O .",
399-
env=env_stub_gen)
398+
f'"{venv_python}" -m nanobind.stubgen -m bindings -r -O bindings',
399+
env=env_stub_gen,
400+
)
401+
# Root stub needs renaming from bindings.pyi to __init__.pyi
402+
bindings_stub = Path("bindings/bindings.pyi")
403+
if bindings_stub.exists():
404+
bindings_stub.rename("bindings/__init__.pyi")
400405
else:
401406
build_run(
402407
f"\"{venv_python}\" -m pybind11_stubgen -o . bindings --exit-code",

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ def has_ext_modules(self):
128128
]
129129

130130
package_data += [
131-
'bindings.pyi',
132131
'bindings/*.pyi',
133132
'tools/plugin_gen/templates/*',
134133
'bench/build/benchmark_config.yml',

0 commit comments

Comments
 (0)