Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix synchros2 aliasing as bdai_ros2_wrappers #135

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

mhidalgo-bdai
Copy link
Contributor

Proposed changes

Follow-up to #133. This one caught me off guard. It turns out it's not enough to alias the top-level package, otherwise CPython will liberally duplicate subpackages and modules, wreaking havoc in any code that relies on globals (like synchros2.scope and synchros2.process).

Thus, this patch eagerly and recursively imports and aliases synchros2 and all its subpackages and modules. This effectively makes import bdai_ros2_wrappers a slower operation, but the penalty is not significant and we will eventually deprecate and remove this alias.

Checklist

  • Lint and unit tests pass locally
  • I have added tests that prove my changes are effective
  • I have added necessary documentation to communicate the changes

@mhidalgo-bdai mhidalgo-bdai force-pushed the mhidalgo-bdai/fix-synchros2-aliasing branch from 311e749 to 6351ce9 Compare December 19, 2024 22:50
@mhidalgo-bdai mhidalgo-bdai merged commit 8793817 into main Dec 20, 2024
4 checks passed
@mhidalgo-bdai mhidalgo-bdai deleted the mhidalgo-bdai/fix-synchros2-aliasing branch December 20, 2024 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants