Skip to content

Pin packaging>=20.0 to fix Theia CI import failure#5369

Open
AntoineRichard wants to merge 4 commits intoisaac-sim:developfrom
AntoineRichard:antoiner/fix/packaging-transformers-ci
Open

Pin packaging>=20.0 to fix Theia CI import failure#5369
AntoineRichard wants to merge 4 commits intoisaac-sim:developfrom
AntoineRichard:antoiner/fix/packaging-transformers-ci

Conversation

@AntoineRichard
Copy link
Copy Markdown
Collaborator

Description

Theia observation tests on CI fail when transformers is imported:

ValueError: Unable to compare versions for packaging>=20.0:
need=20.0 found=None. This is unusual. Consider reinstalling
packaging.

transformers calls importlib.metadata.version("packaging") at import time. On Isaac Sim's bundled Python, packaging is on sys.path but the dist-info metadata is missing, so the lookup returns None. Because setup.py listed packaging without a version floor, pip considered the broken copy satisfied and skipped reinstall.

Add >=20.0 (matching transformers' own require_version call) so pip re-resolves packaging and reinstalls it with valid metadata.

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
List any dependencies that are required for this change.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the changelog and the corresponding version in the extension's config/extension.toml file
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

Theia observation tests on CI fail when transformers is imported:

    ValueError: Unable to compare versions for packaging>=20.0:
    need=20.0 found=None. This is unusual. Consider reinstalling
    packaging.

transformers calls importlib.metadata.version("packaging") at import
time. On Isaac Sim's bundled Python, packaging is on sys.path but the
dist-info metadata is missing, so the lookup returns None. Because
setup.py listed packaging without a version floor, pip considered the
broken copy satisfied and skipped reinstall.

Add >=20.0 (matching transformers' own require_version call) so pip
re-resolves packaging and reinstalls it with valid metadata.
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Apr 23, 2026
Copy link
Copy Markdown

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Choose a reason for hiding this comment

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

🤖 Isaac Lab Review Bot

Summary

This PR pins packaging>=20.0 in setup.py to fix a CI failure where transformers import fails due to Isaac Sim's bundled packaging library lacking proper dist-info metadata. The fix is minimal, targeted, and correctly documented. The version floor matches the constraint that transformers itself checks at runtime.

Architecture Impact

Self-contained. This change only affects dependency resolution at install time. No runtime code paths are modified. The packaging library is a pure Python utility for version parsing — adding a version floor has no impact on Isaac Lab's tensor pipelines, physics stepping, or RL training loops.

Implementation Verdict

Ship it

Test Coverage

This is a dependency/CI fix, not a logic change. The "test" is whether CI passes after the change — specifically the Theia observation tests that import transformers. No unit test is needed or appropriate for a setup.py dependency pin. The PR description indicates this fixes an existing CI failure, which will serve as implicit validation.

CI Status

No CI checks available yet. The PR should be validated by confirming the Theia-based observation tests pass after merge.

Findings

🔵 Improvement: source/isaaclab/setup.py:54-55 — Comment accuracy
The inline comment is excellent and explains the why clearly. However, the comment says "forces pip to reinstall" which is slightly imprecise — pip will reinstall only if the existing installation doesn't satisfy the constraint. This is minor and the current wording is acceptable for practical purposes.

🔵 Improvement: source/isaaclab/docs/CHANGELOG.rst:3 — Changelog entry is thorough
The changelog entry at lines 3-14 correctly documents the root cause (missing dist-info metadata in Isaac Sim's bundled packaging), the symptom (ValueError on transformers import), and the fix. This is well-written documentation.

🔵 Note: source/isaaclab/config/extension.toml:4 — Version bump is correct
Version incremented from 4.6.11 to 4.6.12 following semver for a patch-level fix. The extension.toml and CHANGELOG.rst are in sync.

No critical or warning-level issues identified. The change is correct, minimal, and well-documented.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 23, 2026

Greptile Summary

Pins packaging>=20.0 in setup.py to fix a CI import failure where Isaac Sim's bundled Python ships packaging without dist-info metadata, causing transformers to raise a ValueError at import time. The patch version is bumped to 4.6.12 and the changelog is updated accordingly.

Confidence Score: 5/5

Safe to merge — minimal, targeted dependency floor that resolves a well-diagnosed CI failure with no functional risk.

All three changed files are trivially correct: the version specifier floor matches transformers' own runtime check, the version bump and changelog are consistent, and no logic changes are introduced.

No files require special attention.

Important Files Changed

Filename Overview
source/isaaclab/setup.py Adds packaging>=20.0 floor to force pip to reinstall the metadata-less Isaac Sim bundled copy; change is minimal and correctly targeted.
source/isaaclab/config/extension.toml Patch version bump from 4.6.11 → 4.6.12, consistent with the changelog entry.
source/isaaclab/docs/CHANGELOG.rst Adds 4.6.12 changelog entry accurately describing the packaging pin fix.

Sequence Diagram

sequenceDiagram
    participant pip
    participant setup.py
    participant IsaacSimPython as Isaac Sim Python
    participant transformers

    pip->>setup.py: resolve install_requires
    setup.py-->>pip: packaging>=20.0
    pip->>IsaacSimPython: check installed packaging version
    IsaacSimPython-->>pip: metadata-less copy (dist-info missing)
    pip->>pip: version constraint not satisfied → reinstall
    pip-->>IsaacSimPython: packaging with valid dist-info
    IsaacSimPython->>transformers: import AutoModel
    transformers->>IsaacSimPython: importlib.metadata.version("packaging")
    IsaacSimPython-->>transformers: "24.x" (valid)
    transformers-->>IsaacSimPython: import succeeds
Loading

Reviews (1): Last reviewed commit: "Pin packaging>=20.0 to fix Theia CI impo..." | Re-trigger Greptile

The previous fix (pinning packaging>=20.0 in isaaclab's setup.py) was
based on a wrong hypothesis. pip treats 26.0 in Isaac Sim's
core_archive/pip_prebundle as satisfying >=20.0 and does not reinstall.
The downgrade to packaging 23.2 in site-packages is actually driven by
isaaclab_rl's "packaging<24" constraint.

On some Isaac Sim develop images, that uninstall/reinstall leaves a
dist-info whose METADATA is missing the "Version:" header. At runtime,
importlib.metadata.version("packaging") then returns None, which breaks
transformers' require_version("packaging>=20.0") at import time and
fails the Theia observation tests.

Add an explicit --force-reinstall of packaging at the end of
command_install so pip rewrites site-packages/packaging-*.dist-info
cleanly after all other installs have settled. Also revert the
setup.py pin, which was a no-op given ovphysx and transformers already
declare packaging>=20.0 transitively.
…ging-transformers-ci

# Conflicts:
#	source/isaaclab/docs/CHANGELOG.rst
PR isaac-sim#5385 marked Isaac-Cartpole-RGB-TheiaTiny-v0 as xfail with the
reason "TheiaTiny environment is currently broken; xfailed pending
fix." The underlying breakage is the packaging METADATA corruption
addressed in this branch: when importlib.metadata.version("packaging")
returns None, transformers' require_version at import time crashes
every TheiaTiny code path.

With the force-reinstall of packaging in command_install, the metadata
is rewritten cleanly and transformers imports succeed, so the xfail
mute is no longer needed. Remove it so CI on this PR actually
exercises the TheiaTiny task and proves the fix works end-to-end
instead of silently passing.

Changelog/extension-version bump deferred; will be added in a
follow-up commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant