diff --git a/examples/README.md b/examples/README.md index a9b62f168a..1806d55702 100644 --- a/examples/README.md +++ b/examples/README.md @@ -97,13 +97,23 @@ the smallest complete one. - With hatchling, use `only-include` + `sources`, **not** `packages`: ```toml - [tool.hatch.build.targets.wheel] + [tool.hatch.build] only-include = ["python/isaaccapture_examples/"] + + [tool.hatch.build.targets.wheel] sources = ["python"] ``` `packages` keeps only the last path component, so it builds without complaint - and produces a wheel rooted at a bare top-level `/`. + and produces a wheel rooted at a bare top-level `/`. `only-include` + goes in `[tool.hatch.build]` so the sdist gets it too. Without it the sdist + takes the whole example directory: tracked media, stray `.mcap` recordings + and, in an example with its own `.gitignore` (hatchling reads only the + nearest one), `uv.lock` and build trees. Files the code reads from the + example root, such as teleop_ros2's `configs/`, are therefore not in the + sdist: run such an example from the source tree or the install tree. + `sources` stays on the wheel: the sdist must keep the `python/` prefix that + the wheel build looks for. - Keep `[tool.uv.sources]` last in the file. `install_python_example()` strips it from the installed copy by matching up to the next `[`, so a block after it loses its comments. diff --git a/examples/camera_viz/pyproject.toml b/examples/camera_viz/pyproject.toml index 05566aebc1..868c1cdebe 100644 --- a/examples/camera_viz/pyproject.toml +++ b/examples/camera_viz/pyproject.toml @@ -62,14 +62,16 @@ viewer = ["isaaccapture[cloudxr]", "pillow>=10.0"] # The native codec's .so is built in place by codec/build.sh, so it is picked up # from the source tree rather than shipped by this build. Hatchling reads only # this directory's .gitignore, so the codec build tree is excluded here. -[tool.hatch.build.targets.wheel] +[tool.hatch.build] only-include = ["python/isaaccapture_examples/camera_viz"] -sources = ["python"] exclude = [ "/python/isaaccapture_examples/camera_viz/codec/build", "/python/isaaccapture_examples/camera_viz/argus/build", "*.so", ] +[tool.hatch.build.targets.wheel] +sources = ["python"] + [tool.uv] python-preference = "only-managed" diff --git a/examples/cloudxr_mujoco_teleop/pyproject.toml b/examples/cloudxr_mujoco_teleop/pyproject.toml index bbe0cb38d4..5d7e556265 100644 --- a/examples/cloudxr_mujoco_teleop/pyproject.toml +++ b/examples/cloudxr_mujoco_teleop/pyproject.toml @@ -24,6 +24,8 @@ dependencies = [ # # vive_assets/ lives inside the package because the modules resolve it from # __file__, so the meshes must travel with them. -[tool.hatch.build.targets.wheel] +[tool.hatch.build] only-include = ["python/isaaccapture_examples/cloudxr_mujoco_teleop"] + +[tool.hatch.build.targets.wheel] sources = ["python"] diff --git a/examples/deviceio_live_view/pyproject.toml b/examples/deviceio_live_view/pyproject.toml index 243b533ec3..006adbaffc 100644 --- a/examples/deviceio_live_view/pyproject.toml +++ b/examples/deviceio_live_view/pyproject.toml @@ -23,8 +23,10 @@ dependencies = [ # `only-include` + `sources`, not `packages`, and no __init__.py above # deviceio_live_view -- see the packaging rules in examples/README.md. -[tool.hatch.build.targets.wheel] +[tool.hatch.build] only-include = ["python/isaaccapture_examples/deviceio_live_view"] + +[tool.hatch.build.targets.wheel] sources = ["python"] [tool.uv.sources] diff --git a/examples/haptic_feedback/pyproject.toml b/examples/haptic_feedback/pyproject.toml index d8c5903789..cd532ecc76 100644 --- a/examples/haptic_feedback/pyproject.toml +++ b/examples/haptic_feedback/pyproject.toml @@ -19,6 +19,8 @@ dependencies = [ # `only-include` + `sources`, not `packages`, and no __init__.py above # haptic_feedback -- see the packaging rules in examples/README.md. -[tool.hatch.build.targets.wheel] +[tool.hatch.build] only-include = ["python/isaaccapture_examples/haptic_feedback"] + +[tool.hatch.build.targets.wheel] sources = ["python"] diff --git a/examples/mcap_record_replay/pyproject.toml b/examples/mcap_record_replay/pyproject.toml index d6bb76e974..89806645f9 100644 --- a/examples/mcap_record_replay/pyproject.toml +++ b/examples/mcap_record_replay/pyproject.toml @@ -25,8 +25,10 @@ dependencies = [ # must stay without an __init__.py. `only-include` + `sources`, not `packages`: # the latter keeps only the last path component and would root the wheel at a # bare top-level `mcap_record_replay/`. -[tool.hatch.build.targets.wheel] +[tool.hatch.build] only-include = ["python/isaaccapture_examples/mcap_record_replay"] + +[tool.hatch.build.targets.wheel] sources = ["python"] [tool.uv.sources] diff --git a/examples/noitom/pyproject.toml b/examples/noitom/pyproject.toml index 5400dcb080..a678b544ad 100644 --- a/examples/noitom/pyproject.toml +++ b/examples/noitom/pyproject.toml @@ -22,6 +22,8 @@ dependencies = [ # `only-include` + `sources`, not `packages`, and no __init__.py above # noitom -- see the packaging rules in examples/README.md. -[tool.hatch.build.targets.wheel] +[tool.hatch.build] only-include = ["python/isaaccapture_examples/noitom"] + +[tool.hatch.build.targets.wheel] sources = ["python"] diff --git a/examples/oglo_tactile/pyproject.toml b/examples/oglo_tactile/pyproject.toml index 66df54bb70..fa9226b858 100644 --- a/examples/oglo_tactile/pyproject.toml +++ b/examples/oglo_tactile/pyproject.toml @@ -20,6 +20,8 @@ dependencies = [ # `only-include` + `sources`, not `packages`, and no __init__.py above # oglo_tactile -- see the packaging rules in examples/README.md. -[tool.hatch.build.targets.wheel] +[tool.hatch.build] only-include = ["python/isaaccapture_examples/oglo_tactile"] + +[tool.hatch.build.targets.wheel] sources = ["python"] diff --git a/examples/oxr/pyproject.toml b/examples/oxr/pyproject.toml index a000590c7a..266122c2bc 100644 --- a/examples/oxr/pyproject.toml +++ b/examples/oxr/pyproject.toml @@ -18,6 +18,8 @@ dependencies = [ # `only-include` + `sources`, not `packages`, and no __init__.py above # oxr -- see the packaging rules in examples/README.md. -[tool.hatch.build.targets.wheel] +[tool.hatch.build] only-include = ["python/isaaccapture_examples/oxr"] + +[tool.hatch.build.targets.wheel] sources = ["python"] diff --git a/examples/retargeting/pyproject.toml b/examples/retargeting/pyproject.toml index d20a54ad63..e630959e9f 100644 --- a/examples/retargeting/pyproject.toml +++ b/examples/retargeting/pyproject.toml @@ -21,6 +21,8 @@ dependencies = [ # must stay without an __init__.py. `only-include` + `sources`, not `packages`: # the latter keeps only the last path component and would root the wheel at a # bare top-level `retargeting/`. -[tool.hatch.build.targets.wheel] +[tool.hatch.build] only-include = ["python/isaaccapture_examples/retargeting"] + +[tool.hatch.build.targets.wheel] sources = ["python"] diff --git a/examples/sharpa_avatar/pyproject.toml b/examples/sharpa_avatar/pyproject.toml index 5e4366e18d..e4d7ba5ef4 100644 --- a/examples/sharpa_avatar/pyproject.toml +++ b/examples/sharpa_avatar/pyproject.toml @@ -22,8 +22,10 @@ dependencies = [ # `only-include` + `sources`, not `packages`, and no __init__.py above # sharpa_avatar -- see the packaging rules in examples/README.md. -[tool.hatch.build.targets.wheel] +[tool.hatch.build] only-include = ["python/isaaccapture_examples/sharpa_avatar"] + +[tool.hatch.build.targets.wheel] sources = ["python"] [tool.uv.sources] diff --git a/examples/soma_body_publisher/pyproject.toml b/examples/soma_body_publisher/pyproject.toml index 30a18ac0d9..d557635a52 100644 --- a/examples/soma_body_publisher/pyproject.toml +++ b/examples/soma_body_publisher/pyproject.toml @@ -16,8 +16,10 @@ dependencies = [ "py-soma-x==0.3.1", ] -[tool.hatch.build.targets.wheel] +[tool.hatch.build] only-include = ["python/isaaccapture_examples/soma_body_publisher"] + +[tool.hatch.build.targets.wheel] sources = ["python"] [tool.uv.sources] diff --git a/examples/soma_hand_publisher/pyproject.toml b/examples/soma_hand_publisher/pyproject.toml index bcd25a8e39..175071a4f7 100644 --- a/examples/soma_hand_publisher/pyproject.toml +++ b/examples/soma_hand_publisher/pyproject.toml @@ -16,8 +16,10 @@ dependencies = [ "py-soma-x==0.3.1", ] -[tool.hatch.build.targets.wheel] +[tool.hatch.build] only-include = ["python/isaaccapture_examples/soma_hand_publisher"] + +[tool.hatch.build.targets.wheel] sources = ["python"] [tool.uv.sources] diff --git a/examples/tactile/pyproject.toml b/examples/tactile/pyproject.toml index d9cdeedcab..5815914fbe 100644 --- a/examples/tactile/pyproject.toml +++ b/examples/tactile/pyproject.toml @@ -15,8 +15,10 @@ dependencies = [ "numpy>=1.23.0", ] -[tool.hatch.build.targets.wheel] +[tool.hatch.build] only-include = ["python/isaaccapture_examples/tactile"] + +[tool.hatch.build.targets.wheel] sources = ["python"] [tool.uv.sources] diff --git a/examples/teleop/pyproject.toml b/examples/teleop/pyproject.toml index df1020cdff..f6bc6163ce 100644 --- a/examples/teleop/pyproject.toml +++ b/examples/teleop/pyproject.toml @@ -27,6 +27,8 @@ ui = ["isaaccapture[ui]"] # # config/ lives inside the package because the bimanual examples resolve it # from __file__, so the YAML and URDF must travel with them. -[tool.hatch.build.targets.wheel] +[tool.hatch.build] only-include = ["python/isaaccapture_examples/teleop"] + +[tool.hatch.build.targets.wheel] sources = ["python"] diff --git a/examples/teleop_ros2/pyproject.toml b/examples/teleop_ros2/pyproject.toml index ee1a93acbb..dab128e039 100644 --- a/examples/teleop_ros2/pyproject.toml +++ b/examples/teleop_ros2/pyproject.toml @@ -33,6 +33,8 @@ testpaths = ["../../tests/python/examples/teleop_ros2"] # must stay without an __init__.py. `only-include` + `sources`, not `packages`: # the latter keeps only the last path component and would root the wheel at a # bare top-level `teleop_ros2/`. -[tool.hatch.build.targets.wheel] +[tool.hatch.build] only-include = ["python/isaaccapture_examples/teleop_ros2"] + +[tool.hatch.build.targets.wheel] sources = ["python"] diff --git a/examples/teleop_session_manager/pyproject.toml b/examples/teleop_session_manager/pyproject.toml index 466cf4a909..89a7cae256 100644 --- a/examples/teleop_session_manager/pyproject.toml +++ b/examples/teleop_session_manager/pyproject.toml @@ -21,6 +21,8 @@ dependencies = [ # must stay without an __init__.py. `only-include` + `sources`, not `packages`: # the latter keeps only the last path component and would root the wheel at a # bare top-level `teleop_session_manager/`. -[tool.hatch.build.targets.wheel] +[tool.hatch.build] only-include = ["python/isaaccapture_examples/teleop_session_manager"] + +[tool.hatch.build.targets.wheel] sources = ["python"] diff --git a/examples/vehicle_teleop/pyproject.toml b/examples/vehicle_teleop/pyproject.toml index f00cb0236f..f45de644eb 100644 --- a/examples/vehicle_teleop/pyproject.toml +++ b/examples/vehicle_teleop/pyproject.toml @@ -29,8 +29,10 @@ dependencies = [ # `only-include` + `sources`, not `packages`, and no __init__.py above # vehicle_teleop -- see the packaging rules in examples/README.md. -[tool.hatch.build.targets.wheel] +[tool.hatch.build] only-include = ["python/isaaccapture_examples/vehicle_teleop"] + +[tool.hatch.build.targets.wheel] sources = ["python"] [[tool.uv.index]]