feat(deprecation): emit DeprecationWarning on import (closes #168)#173
Open
yinsong1986 wants to merge 1 commit into
Open
feat(deprecation): emit DeprecationWarning on import (closes #168)#173yinsong1986 wants to merge 1 commit into
yinsong1986 wants to merge 1 commit into
Conversation
…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.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Emit a
DeprecationWarningat top-level package import (import strands_robots_sim) that points users at the concrete migration commandpip install strands-robots[isaac].Why
Per the deprecation epic (#167), the Isaac Sim backend now ships as an in-tree builtin of
strands-robots, sostrands-robots-simis 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__.pywarnings.warn(..., DeprecationWarning, stacklevel=2)at module load.stacklevel=2attributes the warning to the caller'simportline, not this module, sopython -W all/ pytest-Woutput points at user code.pip install strands-robots[isaac], links the deprecation epic ([EPIC] Deprecate robots-sim (Isaac backend moved to strands-labs/robots) #167), and referencesexamples/MIGRATION.md... deprecated::note to the module docstring.strands_robots_sim/isaac/tests/test_deprecation_warning.py(new pin test)DeprecationWarning.__version__,__all__) survives the warning.Test surface
hatch run lint— clean (black / isort / flake8).hatch run test—267 passed, 40 skipped(skips are GPU/env-gated). The 3 new tests intest_deprecation_warning.pypass.filterwarnings = errorin[tool.pytest.ini_options], and the legacy-name__getattr__guard already raisesImportError(not a warning) so-W error::DeprecationWarningenvs are unaffected.Acceptance criteria (from #168)
DeprecationWarningemitted on package importpip 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.