Skip to content

feat(deprecation): emit DeprecationWarning on import (closes #168)#173

Open
yinsong1986 wants to merge 1 commit into
strands-labs:mainfrom
yinsong1986:feat/deprecation-warning-on-import
Open

feat(deprecation): emit DeprecationWarning on import (closes #168)#173
yinsong1986 wants to merge 1 commit into
strands-labs:mainfrom
yinsong1986:feat/deprecation-warning-on-import

Conversation

@yinsong1986

Copy link
Copy Markdown
Contributor

What

Emit a DeprecationWarning at top-level package import (import strands_robots_sim) that points users at the concrete migration command pip install strands-robots[isaac].

Why

Per the deprecation epic (#167), the Isaac Sim backend now ships as an in-tree builtin of strands-robots, so strands-robots-sim is being deprecated and will be archived. This is the "DeprecationWarning on import" child of that epic (#168). Surfacing the notice at import time gives existing users a runtime signal — before the final release + PyPI deprecation land — with a copy-pasteable migration command.

Changes

  • strands_robots_sim/__init__.py
    • warnings.warn(..., DeprecationWarning, stacklevel=2) at module load. stacklevel=2 attributes the warning to the caller's import line, not this module, so python -W all / pytest -W output points at user code.
    • Message names pip install strands-robots[isaac], links the deprecation epic ([EPIC] Deprecate robots-sim (Isaac backend moved to strands-labs/robots) #167), and references examples/MIGRATION.md.
    • Added a .. deprecated:: note to the module docstring.
  • strands_robots_sim/isaac/tests/test_deprecation_warning.py (new pin test)
    • Fresh import emits exactly one DeprecationWarning.
    • Message names the migration command and states the package is deprecated.
    • Public surface (__version__, __all__) survives the warning.

Test surface

  • hatch run lint — clean (black / isort / flake8).
  • hatch run test267 passed, 40 skipped (skips are GPU/env-gated). The 3 new tests in test_deprecation_warning.py pass.
  • The warning does not become an error in the suite: there is no filterwarnings = error in [tool.pytest.ini_options], and the legacy-name __getattr__ guard already raises ImportError (not a warning) so -W error::DeprecationWarning envs are unaffected.

Acceptance criteria (from #168)

  • DeprecationWarning emitted on package import
  • Points users to pip install strands-robots[isaac]

Out-of-scope follow-ups (other #167 children, not this PR)

Project board

If this issue is on the Strands Labs - Robots board, please move it to In review (couldn't confirm board membership from the API in this session).

Closes #168.

…trands-labs#168)

The Isaac Sim backend now ships as an in-tree builtin of strands-robots,
so strands-robots-sim is being deprecated and archived (epic strands-labs#167).

Emit a DeprecationWarning at top-level package import that points users
at the concrete migration command `pip install strands-robots[isaac]`,
the deprecation epic (strands-labs#167), and examples/MIGRATION.md. Use stacklevel=2
so the warning is attributed to the caller's import line rather than to
this module.

Also add a `.. deprecated::` note to the package docstring and a pin
test (strands_robots_sim/isaac/tests/test_deprecation_warning.py) that
asserts a fresh import emits exactly one DeprecationWarning naming the
migration command, and that the public surface (__version__) survives
the warning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deprecation Deprecating robots-sim

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Emit DeprecationWarning on import

2 participants