Skip to content

fix: track swift's SwiftElement.py -> Elements.py rename - #624

Open
petercorke wants to merge 1 commit into
mainfrom
fix/swift-elements-import
Open

fix: track swift's SwiftElement.py -> Elements.py rename#624
petercorke wants to merge 1 commit into
mainfrom
fix/swift-elements-import

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Summary

  • swift (jhavl/swift) is renaming src/swift/SwiftElement.py -> Elements.py, to avoid a module/class name collision that was confusing mypy (the file and the SwiftElement class inside it shared a name, and the class is re-exported at swift's package top level) -- see jhavl/swift#141.
  • roboticstoolbox/backends/swift/__init__.py imports directly from the submodule path (from swift.SwiftElement import ...) rather than from swift's own top-level re-exports, so it needs the matching one-line fix to keep working once that rename ships in a released swift-sim version.
  • Not urgent -- nothing's broken yet, since swift's rename hasn't merged/released. This just keeps the two repos in sync before it does.

Test plan

  • Loaded backends/swift/__init__.py standalone (via importlib) against a local swift checkout with the rename already applied -- resolves Swift, Slider, SwiftElement, etc. correctly from swift.Elements

swift renamed src/swift/SwiftElement.py -> Elements.py (avoids a
module/class name collision that was confusing mypy -- the file and
the SwiftElement class inside it shared a name, and the class is
re-exported at swift's package top level) -- jhavl/swift#141.

roboticstoolbox/backends/swift/__init__.py imported directly from
the submodule path (from swift.SwiftElement import ...) rather than
from the swift package's own top-level re-exports, so it needs the
same one-line fix to keep working once that rename ships in a
released swift-sim version.

Verified by loading this file standalone (importlib) against a swift
checkout with the rename already applied -- resolves Swift, Slider,
SwiftElement etc. correctly from swift.Elements.
@codecov

codecov Bot commented Aug 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (6e3508b) to head (eecc6d9).

Files with missing lines Patch % Lines
src/roboticstoolbox/backends/swift/__init__.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main    #624   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files        142     142           
  Lines      13898   13898           
=====================================
  Misses     13898   13898           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant