Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

examples: use proper pyproject.toml setup for all python ones

未关闭
#985 1 条评论 0 个 reaction 已指派 2 人 在 GitHub 查看

维护者通常 1 天内回复

@jiwenc-nv 已经在做这个了。

开始于 2026年8月28日。

评估

这个 Issue 还没有评估数据。

描述

Partner feedback on #736 (item 5): the Physical AI Developer team copied example code into their own project, hit import failures, and patched their copies with dual-mode import guards. Worth settling a convention rather than leaving each example to pick one.

Two conventions coexist under examples/:

  • mujoco_xr — its own wheel, isaacteleop_examples.mujoco_xr namespace, relative imports, documented as python -m. Copies cleanly.
  • camera_viz and teleop_ros2/python — 21 files import siblings as top-level modules: from pipeline import ..., from sources import ..., from messages import ..., from geometry import .... These resolve only because the script's own directory lands on sys.path.

So the second group breaks under python -m, breaks the moment a file is copied into a package (what the partner hit), and squats on very generic top-level names — pipeline, sources, messages, constants, assets. examples/teleop_ros2/python/pyproject.toml already carries pythonpath = ["."] to keep pytest working around it.

Suggested direction: make both directories real packages with relative imports plus a -m entry point, matching mujoco_xr, and write the convention down for examples. I'd avoid adopting try: from .x / except ImportError: from x guards repo-wide — that doubles every import site to paper over an invocation mistake.

Cross-repo note: huggingface/lerobot's examples/isaac_teleop_to_so101/ uses files(__package__) (common.py:76) and relative imports. Its README documents python -m only, so it works as specified; recording it here for traceability.

主要语言
Python
星标
393
派生
93
平均合并
2 天 5 小时
30 天内合并 PR
95

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

NVIDIA/IsaacCapture 的其他 Issue

查看 NVIDIA/IsaacCapture 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。