Skip to content

feat(cli): support 'python -m concore_cli' - #695

Open
yadavchiragg wants to merge 1 commit into
ControlCore-Project:devfrom
yadavchiragg:feat/cli-main-module
Open

yadavchiragg wants to merge 1 commit into
ControlCore-Project:devfrom
yadavchiragg:feat/cli-main-module

Conversation

@yadavchiragg

Copy link
Copy Markdown

Problem

python3 -m concore_cli fails with "'concore_cli' is a package and cannot be directly executed" because the package has no __main__.py. This is the usual fallback when the concore script is not on PATH (for example a virtual environment that isn't activated).

Change

Add concore_cli/__main__.py so python -m concore_cli ... runs the same CLI. prog_name="concore" keeps --help showing Usage: concore instead of python -m concore_cli.

Testing

  • tests/test_cli_main_module.py (2 tests): --version and --help via python -m; both fail without __main__.py
  • ruff clean

Docs

One note under Installation in concore_cli/README.md

Running 'python -m concore_cli' failed with "'concore_cli' is a package and cannot be directly executed" because the package had no __main__.py. Add it so the CLI also runs as a module when the concore script is not on PATH. Tests and docs included.
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