Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/source/overview/developer-guide/template.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ The template generator enables you to create an:

.. warning::

If you installed Isaac Lab via pip, any task generated by template outside of the pip-installed environment may not
be discovered properly. We are working on better support, but please prefer external projects when using
isaac lab pip installation.
Pip installations of Isaac Lab do not support *Internal* templates.
If ``isaaclab`` is loaded from ``site-packages`` or ``dist-packages``, the *Internal* option is disabled
and the *External* template will be used instead.

Running the template generator
------------------------------
Expand Down
32 changes: 20 additions & 12 deletions tools/template/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# SPDX-License-Identifier: BSD-3-Clause

import enum
import importlib
import os
from collections.abc import Callable

Expand Down Expand Up @@ -147,18 +148,25 @@ def main() -> None:
"""Main function to run template generation from CLI."""
cli_handler = CLIHandler()

# project type
is_external_project = (
cli_handler.input_select(
"Task type:",
choices=["External", "Internal"],
long_instruction=(
"External (recommended): task/project is in its own folder/repo outside the Isaac Lab project.\n"
"Internal: the task is implemented within the Isaac Lab project (in source/isaaclab_tasks)."
),
).lower()
== "external"
)
lab_module = importlib.import_module("isaaclab")
lab_path = os.path.realpath(getattr(lab_module, "__file__", "") or (getattr(lab_module, "__path__", [""])[0]))
is_lab_pip_installed = ("site-packages" in lab_path) or ("dist-packages" in lab_path)

if not is_lab_pip_installed:
# project type
is_external_project = (
cli_handler.input_select(
"Task type:",
choices=["External", "Internal"],
long_instruction=(
"External (recommended): task/project is in its own folder/repo outside the Isaac Lab project.\n"
"Internal: the task is implemented within the Isaac Lab project (in source/isaaclab_tasks)."
),
).lower()
== "external"
)
else:
is_external_project = True

# project path (if 'external')
project_path = None
Expand Down
Loading