Skip to content

Fix Python 3.10 unified CLI imports - #560

Merged
skywhite1024 merged 1 commit into
mainfrom
codex/fix-python310-cli-import
Aug 27, 2026
Merged

Fix Python 3.10 unified CLI imports#560
skywhite1024 merged 1 commit into
mainfrom
codex/fix-python310-cli-import

Conversation

@skywhite1024

Copy link
Copy Markdown
Collaborator

Description

Restore the unified embodichain CLI on Python 3.10 by falling back to importlib.abc.Traversable when importlib.resources.abc is unavailable.

Commit 1352f988 introduced the Python 3.11+ import path while the project still declares requires-python = ">=3.10". On Python 3.10, every python -m embodichain ... command failed during module import before subcommand dispatch. Python 3.11+ keeps using the existing resource import path.

Dependencies: none.

Issue: none.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (existing functionality will not work without user modification)
  • Documentation update

Screenshots

Not applicable; this is a CLI import compatibility fix.

Validation

  • conda run -n embodichain040 black --check --diff --color ./ (811 files unchanged)
  • python docs/scripts/check_api_docs.py (1714/1714 exports documented)
  • Python 3.10.20: python -m embodichain --help
  • Python 3.10.20: python -m embodichain preview-asset --help
  • Python 3.10.20: pytest tests/test_main.py -q (11 passed)
  • git diff --check

Checklist

  • I have run the Black formatting gate.
  • Documentation changes are not required for this compatibility fix.
  • Public API documentation coverage is aligned.
  • Existing CLI tests prove the fix under Python 3.10.
  • Dependencies have not changed.

Fall back to importlib.abc.Traversable on Python 3.10, where importlib.resources is a module rather than a package. This restores every unified CLI command while preserving the Python 3.11+ import path.
Copilot AI lite review requested due to automatic review settings August 27, 2026 11:20
@skywhite1024 skywhite1024 added the bug Something isn't working label Aug 27, 2026

Copilot AI left a comment

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.

Pull request overview

This pull request restores compatibility of the unified python -m embodichain ... CLI on Python 3.10 by conditionally importing Traversable from the appropriate stdlib location, preventing import-time failure before subcommand dispatch.

Changes:

  • Add a try/except import fallback for Traversable to support Python 3.10 when importlib.resources.abc is unavailable.
  • Preserve the existing Python 3.11+ import path for Traversable when available.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown

Greptile Summary

Restores unified CLI imports on Python 3.10 while preserving the existing Python 3.11+ path.

  • Adds a ModuleNotFoundError fallback from importlib.resources.abc.Traversable to importlib.abc.Traversable.
  • Introduces no dependency or runtime behavior changes beyond import compatibility.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness, compatibility, or security issues identified.

The fallback catches the Python 3.10 missing-module condition and resolves the equivalent standard-library type, while Python 3.11 and later retain the existing import path.

Important Files Changed

Filename Overview
embodichain/main.py Adds a correct version-compatible Traversable import fallback; no actionable defects were identified.

Reviews (1): Last reviewed commit: "fix(cli): support Python 3.10 resource i..." | Re-trigger Greptile

@skywhite1024
skywhite1024 merged commit ef2b004 into main Aug 27, 2026
6 checks passed
@skywhite1024
skywhite1024 deleted the codex/fix-python310-cli-import branch August 27, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants