Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#985 1 bình luận 0 reaction 2 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@jiwenc-nv đang làm issue này rồi.

Từ ngày 28/8/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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.

Ngôn ngữ chính
Python
Star
393
Fork
93
Merge trung bình
2 ngày 5 giờ
Pull request đã merge (30 ngày)
95

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NVIDIA/IsaacCapture

Tất cả issue của NVIDIA/IsaacCapture

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.