Skip to content

fix(cli): register the integration commands on the installed entry point - #93

Merged
srpatcha merged 2 commits into
embeddedos-org:masterfrom
junyeong-Cho:fix/cli-register-integration-commands
Sep 1, 2026
Merged

fix(cli): register the integration commands on the installed entry point#93
srpatcha merged 2 commits into
embeddedos-org:masterfrom
junyeong-Cho:fix/cli-register-integration-commands

Conversation

@junyeong-Cho

Copy link
Copy Markdown

Summary

The installed ebuild console script did not expose five documented commands: integration, qemu, sdk, package, and models.

pyproject.toml maps the console script directly to ebuild.cli.commands:cli, while these five commands are defined in ebuild/cli/integration.py and attached through register_commands().

Previously, register_commands() was only called from ebuild/__main__.py, which runs for python -m ebuild but not for the installed ebuild console script.

As a result:

  • python -m ebuild --help exposed all 25 commands.
  • ebuild --help exposed only 20 commands.
  • Documented commands such as ebuild sdk failed with No such command.

This change registers the integration commands directly on the CLI group so both entry points expose the same command set.

Type of Change

  • feat — New feature
  • fix — Bug fix
  • docs — Documentation only
  • style — Formatting, no code change
  • refactor — Code restructuring without behavior change
  • test — Add or fix tests
  • build — Build system or dependency changes
  • ci — CI/CD pipeline changes
  • perf — Performance improvement

Changes

  • Updated ebuild/cli/commands.py to call register_commands(cli) after the CLI group and its commands are defined.
  • Removed the now-redundant registration from ebuild/__main__.py.
  • Added tests/unit/test_integration_commands_registered.py with regression coverage for all five commands and both CLI entry points.

Testing

  • Unit tests pass
  • Integration tests pass
  • Manual testing performed
  • New tests added for new functionality

Test environment:

  • WSL Ubuntu
  • Python 3.10
  • pytest 9.1.1

Full test suite:

$ python -m pytest -q

304 passed in 3.24s

Manual validation:

$ ebuild --help

Confirmed that the installed console script now exposes:

integration
models
package
qemu
sdk

The new regression suite also verifies that:

  • all five integration commands are registered on the installed CLI group;
  • --help succeeds for each command;
  • ebuild and python -m ebuild expose the same command set;
  • [project.scripts] continues to point to the CLI object being tested.

Pre-Submission Checklist

  • Code compiles without warnings (-Wall -Wextra -Werror for C)
  • All existing tests pass
  • New tests added for new functionality
  • Documentation updated if API changed — no API change; this change makes the existing documentation accurate
  • Commit messages follow <type>(<scope>): <description> convention
  • Branch is rebased on latest master

Related Issues

No issue is closed by this PR.

Related: #77 introduces a different package command. integration.py already defines a package command for producing a hardware-target deliverable ZIP, so if both implementations remain, the project may need to decide which behavior should own the ebuild package command name.

This PR does not attempt to resolve that separate design question.

Screenshots / Logs

Before this change:

$ ebuild sdk --target stm32f4 --output out
Usage: ebuild [OPTIONS] COMMAND [ARGS]...
Error: No such command 'sdk'.

$ python3 -m ebuild sdk --target stm32f4 --output out
EoS SDK generated for stm32f4

The installed console script exposed 20 commands while python -m ebuild exposed 25.

After this change:

$ python -m pytest -q
304 passed in 3.24s

ebuild --help now exposes the same five previously missing commands: integration, models, package, qemu, and sdk.

Additional Notes

Registering the commands on the CLI group itself, rather than changing the [project.scripts] entry point, keeps the installed ebuild command, python -m ebuild, and code that imports cli using the same command set.

There is no import cycle introduced by this change: integration.py imports ebuild.cli.logger, ebuild.system.rootfs, and ebuild, none of which import ebuild.cli.commands.

A separate related issue exists in the plugin system: discover_plugins(), register_plugin_commands(), and the plugin notification hooks are currently not wired into CLI startup despite being documented. That is intentionally outside the scope of this PR.

Signed-off-by: Joonyoung Cho <fromochatime@gmail.com>
srpatcha
srpatcha previously approved these changes Sep 1, 2026
@srpatcha
srpatcha merged commit ea269d6 into embeddedos-org:master Sep 1, 2026
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