Skip to content

[1.4] core: Fix nmea_injector failing to import its own package - #4128

Open
joaoantoniocardoso wants to merge 1 commit into
bluerobotics:1.4-devfrom
joaoantoniocardoso:fix/1.4-nmea-injector-import
Open

[1.4] core: Fix nmea_injector failing to import its own package#4128
joaoantoniocardoso wants to merge 1 commit into
bluerobotics:1.4-devfrom
joaoantoniocardoso:fix/1.4-nmea-injector-import

Conversation

@joaoantoniocardoso

Copy link
Copy Markdown
Member

Closes #4127

  • tested.

nmea_injector is the only service whose main.py imports its own package
by name, and it lived inside that package. Running it directly puts the
package directory itself on sys.path, so `import nmea_injector` cannot
resolve and the service crash-loops on startup.

This used to work because install-services.sh ran `pip3 install .` for
every service, installing them as packages. The uv migration set
`package = false` everywhere, which stopped that, and nmea_injector was
the only service that depended on it.

Moving main.py up to the service root puts the parent directory on
sys.path instead, matching every other service and the layout master
already uses.

Rename cherry-picked from b95daa2,
dropping its unrelated shebang and wifi changes.
@joaoantoniocardoso
joaoantoniocardoso requested a review from a team August 11, 2026 21:36
@joaoantoniocardoso joaoantoniocardoso changed the title core: Fix nmea_injector failing to import its own package [1.4] core: Fix nmea_injector failing to import its own package Aug 11, 2026
@github-actions

Copy link
Copy Markdown

Automated PR Review

0. Summary

  • Verdict: LGTM :shipit:

Moves core/services/nmea_injector/nmea_injector/main.py up one level to core/services/nmea_injector/main.py and updates core/start-blueos-core accordingly. This resolves the ImportError when the entrypoint sat inside its own package — running python .../nmea_injector/nmea_injector/main.py puts the inner package directory on sys.path[0], so from nmea_injector.TrafficController import ... cannot resolve. Master already ships this layout, so this backports the fix to 1.4-dev.

No further comments, nice job 👍

Generated by PR Review Bot. This is advisory, a human reviewer must still approve.

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