mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-06 07:48:50 +08:00
Fix ns-install-cli (#1754)
* Make ns-dev-sync-viser-message-defs a tyro CLI to fix ns-install-cli error * Fix pylint
This commit is contained in:
1 parent
2f18e323cd
commit
c1c7a3b283
2 files changed
+9
-2
No files matched your search
@@ -31,6 +31,7 @@ HEADER_LINE = "# Source nerfstudio autocompletions."
|
|||||||
|
|
||||||
|
|
||||||
def _get_all_entry_points() -> List[str]:
|
def _get_all_entry_points() -> List[str]:
|
||||||
|
# TODO: we should filter out entrypoints that are not tyro CLIs.
|
||||||
entry_points = importlib_metadata.distribution("nerfstudio").entry_points
|
entry_points = importlib_metadata.distribution("nerfstudio").entry_points
|
||||||
return [x.name for x in entry_points]
|
return [x.name for x in entry_points]
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
"""Generate viser message definitions for TypeScript, by parsing Python dataclasses."""
|
"""Generate viser message definitions for TypeScript, by parsing Python dataclasses."""
|
||||||
|
|
||||||
import pathlib
|
import pathlib
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
import tyro
|
||||||
from viser.infra import generate_typescript_interfaces
|
from viser.infra import generate_typescript_interfaces
|
||||||
|
|
||||||
from nerfstudio.viewer.viser import NerfstudioMessage
|
from nerfstudio.viewer.viser import NerfstudioMessage
|
||||||
|
|
||||||
|
|
||||||
def entrypoint() -> None:
|
def main() -> None:
|
||||||
"""Generate viser message definitions for TypeScript, by parsing Python dataclasses."""
|
"""Generate viser message definitions for TypeScript, by parsing Python dataclasses."""
|
||||||
|
|
||||||
# Generate typescript source.
|
# Generate typescript source.
|
||||||
@@ -32,5 +32,11 @@ def entrypoint() -> None:
|
|||||||
subprocess.run(args=["prettier", "-w", str(target_path)], check=False)
|
subprocess.run(args=["prettier", "-w", str(target_path)], check=False)
|
||||||
|
|
||||||
|
|
||||||
|
def entrypoint() -> None:
|
||||||
|
"""Entrypoint for use with pyproject scripts."""
|
||||||
|
# All entrypoints must currently be tyro CLIs.
|
||||||
|
tyro.cli(main)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
entrypoint()
|
entrypoint()
|
||||||
Reference in new issue
Block a user