Skip to content

[Workflow] Update extra paths configuration for all workflows - #6644

Open
StafaH wants to merge 7 commits into
isaac-sim:developfrom
StafaH:mh/extrapaths_fix
Open

[Workflow] Update extra paths configuration for all workflows#6644
StafaH wants to merge 7 commits into
isaac-sim:developfrom
StafaH:mh/extrapaths_fix

Conversation

@StafaH

@StafaH StafaH commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #6475.

This change makes Python import-path configuration consistent across Isaac Lab source checkouts, installed packages, and generated external projects, including both VS Code/Pylance and Cursor/basedpyright.

The configuration is split by ownership:

  • Checked-in Pyright policy lives in pyproject.toml.
  • Machine-specific paths are written to a git-ignored pyrightconfig.json that extends the project policy.
  • VS Code settings retain interpreter and editor behavior without defining a competing python.analysis.extraPaths value.

The shared isaaclab.utils.editor utility discovers:

  • Isaac Sim extension paths from the selected installation.
  • Isaac Lab monorepo packages under source/*.
  • Standard downstream packages under a src layout.
  • Isaac Lab packages visible to the active interpreter, covering editable and wheel installs.

The repository setup script and installed-package workflow now use that shared utility. The template generator copies the canonical setup wrapper instead of maintaining a second implementation, and the generated pyproject.toml, README, tests, and documentation are aligned with the new single-package uv src layout introduced on develop. Invalid explicit --isaac_path values now fail clearly rather than silently selecting another installation.

No new runtime dependency is required.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Documentation update

Release backport

  • Backport this pull request to the active release branch after it merges into develop

Screenshots

Not applicable.

Validation

  • uv run pytest source/isaaclab_rl/test/test_template_generator.py source/isaaclab/test/cli/test_installed_workflow_entrypoints.py -q — 34 passed
  • uv run pytest --confcutdir=tools/template tools/template/test_cli.py -q — 7 passed
  • uv run pytest source/isaaclab/test/cli/test_wheel_builder_metadata.py -q — 11 passed
  • Pyright 1.1.411 configuration check — 0 errors and 0 warnings
  • uv run isaaclab -f — passed, including changelog validation against the current upstream develop
  • uv run --isolated --extra dev -- make -C docs current-docs — warning-free build passed

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with uv run isaaclab -f
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package
  • My name already exists in CONTRIBUTORS.md

@greptile-apps

greptile-apps Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR moves editor search paths into shared Pyright configuration. The main changes are:

  • Adds in-repository package roots to the root Pyright settings.
  • Generates pyrightconfig.json for external projects.
  • Adds Isaac Sim path discovery and generated-file ignore rules.
  • Updates VS Code and Cursor setup documentation.

Confidence Score: 4/5

The generated editor setup can hide real import errors and accept an invalid Isaac Sim path.

  • The generated root configuration disables unresolved-import diagnostics for the whole project.
  • An invalid prompted path can silently select another installation or omit Kit paths.
  • The source-path and ignore-rule changes otherwise match the generated project layout.

tools/template/templates/external/.vscode/tools/setup_vscode.py

Important Files Changed

Filename Overview
tools/template/templates/external/.vscode/tools/setup_vscode.py Generates shared Pyright settings, but hides unresolved imports and silently ignores an invalid explicit Isaac Sim path.
tools/template/generator.py Adds the generated root Pyright configuration to external projects' ignore rules.
pyproject.toml Adds all current in-repository source package roots to Pyright.
tools/template/templates/external/.vscode/tools/settings.template.json Removes the Pylance-only extraPaths setting in favor of root Pyright configuration.
tools/template/templates/external/README.md Documents external-project setup for Pylance and basedpyright.
docs/source/overview/developer-guide/vs_code.rst Documents in-repository Pyright paths and Cursor support.

Reviews (1): Last reviewed commit: "Fix extraPaths" | Re-trigger Greptile

Comment on lines +125 to +127
"typeCheckingMode": "basic",
"reportMissingImports": "none",
"reportMissingModuleSource": "none",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Missing Imports Become Invisible

After setup_python_env writes this root configuration, Pylance and basedpyright stop reporting every unresolved import, including misspelled project imports and missing dependencies. The generated search paths should resolve the intended Kit modules without globally disabling these diagnostics.

Suggested change
"typeCheckingMode": "basic",
"reportMissingImports": "none",
"reportMissingModuleSource": "none",
"typeCheckingMode": "basic",

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +48 to +49
if isaac_path and os.path.exists(isaac_path):
return isaac_path

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Invalid Explicit Path Is Ignored

When the VS Code task supplies a nonexistent --isaac_path, this branch silently ignores the prompted value and probes another installation or _isaac_sim. A typo can therefore generate paths for the wrong installation, or omit Kit paths entirely, instead of reporting that the required input is invalid.

Suggested change
if isaac_path and os.path.exists(isaac_path):
return isaac_path
if isaac_path:
if os.path.exists(isaac_path):
return isaac_path
raise ValueError(f"Isaac Sim path does not exist: {isaac_path}")

@AntoineRichard

AntoineRichard commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

[P2] Update the troubleshooting instructions

The generated README troubleshooting section still tells users to add or remove python.analysis.extraPaths in .vscode/settings.json. This PR removes that setting and places the paths in pyrightconfig.json, so those troubleshooting steps no longer affect the configured paths.

Easy fix:

  • Replace .vscode/settings.json with the root pyrightconfig.json.
  • Replace the python.analysis.extraPaths key with extraPaths.
  • In the crash section, tell users to remove unneeded entries from the extraPaths array rather than comment them out.

For example: “If an extension is missing, add its source directory to extraPaths in the root pyrightconfig.json. To reduce indexing, remove unused Isaac Sim extension directories from that same array.”

@AntoineRichard AntoineRichard left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Let's get this in. Cursor is annoying ATM, left a couple comments.

@AntoineRichard

Copy link
Copy Markdown
Collaborator

[P2] Preserve the existing Pyright configuration when generating the local config

pyrightconfig.json and [tool.pyright] are not merged. When both exist, Pyright gives pyrightconfig.json precedence and ignores the [tool.pyright] section entirely (Pyright documentation).

The template generator first copies the root pyproject.toml into the external project. Before running setup_python_env, that complete configuration controls the analysis scope, exclusions, Python version/platform, and diagnostic overrides. After write_pyright_config() creates pyrightconfig.json, only the four generated keys apply; the remaining checked-in settings are silently dropped. Running an IDE setup task therefore changes more than just the import search paths.

We do still need to replace extraPaths, because the copied paths are repository-specific and the generated project needs its own source and Isaac Sim paths. A small way to preserve the rest of the checked-in policy is to inherit it and override only that key:

config = {
    "extends": "./pyproject.toml",
    "extraPaths": extra_paths,
}

Pyright supports extending JSON or TOML configurations, and keys in the child configuration override the base. If dropping the other settings is intentional for external projects, could we instead document that policy and add a test for the resulting configuration?

@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Sep 4, 2026
@StafaH StafaH changed the title Fix extraPaths [Workflow] Update extra paths configuration for all workflows Sep 4, 2026
@StafaH

StafaH commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 4, 2026
@StafaH

StafaH commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation infrastructure isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants