Skip to content

🔥 Remove console scripts whose target modules no longer exist - #1011

Merged
burgholzer merged 2 commits into
munich-quantum-toolkit:mainfrom
cnYui:fix/remove-dead-console-scripts
Sep 6, 2026
Merged

🔥 Remove console scripts whose target modules no longer exist#1011
burgholzer merged 2 commits into
munich-quantum-toolkit:mainfrom
cnYui:fix/remove-dead-console-scripts

Conversation

@cnYui

@cnYui cnYui commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖

Description

[project.scripts] still declares two console scripts inherited from mqt.bench v1 whose target modules were removed during the v2 refactor:

"create_mqt_bench_zip" = "mqt.bench.utils:create_zip_file"
"generate_mqt_bench" = "mqt.bench.benchmark_generator:generate"

Neither src/mqt/bench/utils.py nor src/mqt/bench/benchmark_generator.py exists on main (nor in package form), and a repo-wide grep for create_zip_file, mqt.bench.utils and benchmark_generator matches only those two lines — nothing in src/, tests/, docs/, or the workflows refers to them. Every pip install mqt.bench therefore puts two executables on PATH that fail immediately.

This PR deletes those two lines. mqt-bench and mqt.bench.cli are untouched.

Reproduction against the published 2.2.3 wheel

Installed mqt_bench-2.2.3-py3-none-any.whl from PyPI (with all dependencies) into a clean venv. Its entry_points.txt declares four scripts while the archive contains neither module:

[console_scripts]
create_mqt_bench_zip = mqt.bench.utils:create_zip_file
generate_mqt_bench = mqt.bench.benchmark_generator:generate
mqt-bench = mqt.bench.cli:main
mqt.bench.cli = mqt.bench.cli:main

utils.py in wheel: False
benchmark_generator.py in wheel: False

Running them:

$ create_mqt_bench_zip
ModuleNotFoundError: No module named 'mqt.bench.utils'          # exit 1
$ generate_mqt_bench
ModuleNotFoundError: No module named 'mqt.bench.benchmark_generator'  # exit 1
$ mqt-bench --help
usage: mqt-bench [-h] --level {alg,indep,nativegates,mapped} ...   # exit 0
$ mqt.bench.cli --help
usage: mqt.bench.cli [-h] --level {alg,indep,nativegates,mapped} ...  # exit 0

Verification of the fix

Resolving every declared entry point against the installed package, before and after:

--- BEFORE (main HEAD) ---
create_mqt_bench_zip -> mqt.bench.utils:create_zip_file          IMPORT FAIL: ModuleNotFoundError: No module named 'mqt.bench.utils'
generate_mqt_bench   -> mqt.bench.benchmark_generator:generate   IMPORT FAIL: ModuleNotFoundError: No module named 'mqt.bench.benchmark_generator'
mqt.bench.cli        -> mqt.bench.cli:main                       True
mqt-bench            -> mqt.bench.cli:main                       True

--- AFTER (this branch) ---
mqt.bench.cli        -> mqt.bench.cli:main                       True
mqt-bench            -> mqt.bench.cli:main                       True

Built a wheel from the patched tree — entry_points.txt now contains only mqt-bench and mqt.bench.cli — installed it, and confirmed the venv's scripts directory holds exactly those two, with mqt-bench --level alg --algorithm ghz --num-qubits 3 still emitting QASM. python -m pytest tests/test_cli.py19 passed.

Not a breaking change

src/mqt/bench/utils.py and src/mqt/bench/benchmark_generator.py are absent at every v2 tag (v2.0.0, v2.0.1, v2.1.0, v2.2.0, v2.2.3 — all return 404). These two executables have never functioned in any v2 release, so nothing can depend on them and no upgrade-guide entry is warranted.

Checklist

  • The pull request only contains commits that are focused and relevant to this change.
  • I have added appropriate tests that cover the new/changed functionality. — n/a: no functional code changed, this is packaging metadata only. The existing tests/test_cli.py already covers the two surviving entry points and passes.
  • I have updated the documentation to reflect these changes. — n/a: no documentation references either script.
  • I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals.
  • I have added migration instructions to the upgrade guide (if needed). — not needed, see "Not a breaking change" above.
  • The changes follow the project's style guidelines and introduce no new warnings.
  • The changes are fully tested and pass the CI checks. — verified locally (tests/test_cli.py, 19 passed) and via the wheel build above; awaiting CI.
  • I have reviewed my own code changes.

If PR contains AI-assisted content:

  • Any agent that created, edited, or submitted GitHub content was explicitly authorized for that scope, as required by our AI Usage Guidelines.
  • Every agent-authored or agent-edited public text body begins with the visible disclosure 🤖 *AI text below* 🤖 (titles are exempt).
  • I have disclosed AI assistance in the PR description.
  • I confirm that I have personally reviewed and understood all AI-generated content, and accept full responsibility for it.

AI disclosure: this change was prepared with Claude Code (Claude Opus 4.8) under my explicit authorization for this scope. The agent located the stale entry points, produced the two-line diff, and ran the reproduction and verification pasted above; I reviewed the diff and the evidence and take responsibility for the contribution. The commit carries an Assisted-by: trailer.

🤖 Generated with Claude Code

`[project.scripts]` still declared two entry points inherited from
mqt.bench v1:

    "create_mqt_bench_zip" = "mqt.bench.utils:create_zip_file"
    "generate_mqt_bench" = "mqt.bench.benchmark_generator:generate"

Both target modules were deleted during the v2 refactor, so every
`pip install mqt.bench` puts two executables on PATH that fail
immediately with `ModuleNotFoundError`. Verified against the published
2.2.3 wheel, whose `entry_points.txt` declares all four scripts while
neither module is contained in the archive.

The remaining `mqt-bench` and `mqt.bench.cli` entry points are
unaffected.

Assisted-by: Claude Opus 4.8 via Claude Code

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Assisted-by: Claude Opus 4.8 via Claude Code

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@burgholzer burgholzer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix 🙌

@burgholzer burgholzer added the fix Fixes something that isn't working label Sep 6, 2026
@burgholzer
burgholzer merged commit c6b43b6 into munich-quantum-toolkit:main Sep 6, 2026
15 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in MQT Applications Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Fixes something that isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants