chore: delete Python tree + simplify wheel/CI for pure-Rust binary#1554
Conversation
This was referenced Jun 5, 2026
Member
Author
|
This pull request is part of a Mergify stack:
|
This was referenced Jun 5, 2026
Contributor
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🔴 ⛓️ Depends-On RequirementsWaiting for
This rule is failing.Requirement based on the presence of
🔴 👀 Review RequirementsWaiting for
This rule is failing.
🔴 🔎 ReviewsWaiting for
This rule is failing.
🟢 🤖 Continuous IntegrationWonderful, this rule succeeded.
🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 📕 PR descriptionWonderful, this rule succeeded.
|
jd
commented
Jun 5, 2026
0ed6917 to
9767f5b
Compare
0aed310 to
33f2759
Compare
Member
Author
Revision history
|
33f2759 to
fdab609
Compare
9767f5b to
bcaa5fa
Compare
fdab609 to
e373ef9
Compare
bcaa5fa to
f74c92d
Compare
e373ef9 to
341abdb
Compare
f74c92d to
8a1fd6c
Compare
341abdb to
34a48aa
Compare
End of the port. With every subcommand native, nothing in the
wheel needs Python anymore — the install-time `mergify` binary
covers the full CLI surface and clap handles unknown-subcommand
suggestions natively. Drop the whole Python superstructure in
one self-consistent change so CI doesn't briefly target a
half-deleted tree.
Deletions:
- `mergify_cli/` — entire Python package (utils, cli, dym,
exit_codes, github_types, stack/cli, __init__, __main__,
__globals + the test suite). All functionality was already
mirrored in the Rust crates; tests live alongside the Rust
code they exercise (~600 tests across the workspace).
- `crates/mergify-py-shim/` — the subprocess bridge that
forwarded un-ported subcommands to Python. No un-ported
subcommands left.
- `compat-tests/` — `pytest` runner that diff'd Python vs.
Rust output via `python -m mergify_cli`. No Python side to
diff against.
- `test_binary_build.py` — verified the Python-specific
Windows UTF-8 re-exec in `cli.py::main`. The Rust binary
handles UTF-8 natively, so the test target no longer exists.
- `poe.toml` + `requirements-uv.txt` — Python toolchain
pinning, irrelevant now.
Modifications:
- `pyproject.toml`:
- Drop `dependencies` (httpx, click, rich, pydantic, …) and
`[dependency-groups] dev` (mypy, ruff, pytest, …) — wheel
has no Python runtime / no Python lint+test.
- Drop `[tool.maturin]` `python-source` + `module-name` so
the wheel doesn't try to bundle a package that's gone.
- Drop `[tool.pytest.ini_options]`, `[tool.mypy]`,
`[tool.ruff]` (long config block) — no Python to configure.
- Keep `bindings = "bin"` + `manifest-path` so maturin still
builds a binary-only wheel for PyPI.
- Lower `requires-python` to `>=3.10` — only matters for the
metadata-side `pip install` resolution, not the runtime.
- `crates/mergify-cli/Cargo.toml` — drop `mergify-py-shim` dep.
- `crates/mergify-cli/src/main.rs`:
- Strip the shim infrastructure: `run_py_shim`,
`inject_global_flags`, `prepend_one`, and `Dispatch::Shim`
are gone. The `Dispatch` enum kept as a single-variant
wrapper so the match in `main` stays exhaustive.
- `dispatch_stack` no longer takes `debug` (was only used by
the shim re-injection) and its `_` fallback exits via a
synthetic `StackProbeCli` clap parse — that's what gives
`stack pussh` clap's "did you mean `push`, `squash`?"
formatting natively.
- Clap parse failures at the binary's root now always exit
via `clap::Error::exit()`, surfacing the same Levenshtein
suggestions for unknown top-level subcommands (`staack`
→ "did you mean `stack`?").
- Tests for `shimmed_dispatch_*` deleted — the shim is gone
and clap's exit-on-error path can't be unit-tested without
subprocess plumbing.
- `.github/workflows/ci.yaml` — drop `linters`, `compat-tests`,
`test` jobs (Python lint/test). Keep `rust` (cargo) +
`wheels` (build matrix) + a new `smoke-test-binary` job that
`pip install`s each per-target wheel and runs `mergify
--help` to catch a broken wheel entry on every supported OS.
- `.github/workflows/func-tests-live.yaml` — replace
`uv run --locked poe live-test` with `pip install --user
pytest && python -m pytest -v func-tests/ -m live` so the
live smoke runs without the poe/uv-deps superstructure.
- `NATIVE_COMMANDS` — add `("stack", "push")` (was missing).
End state: the wheel is one Rust binary + LICENSE; clap covers
the full CLI; PyPI publishing pipeline unchanged.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Change-Id: I04684089465879a1fb0769cd85f66d18d2787527
34a48aa to
d69a6fb
Compare
8a1fd6c to
1a27b20
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
End of the port. With every subcommand native, nothing in the
wheel needs Python anymore — the install-time
mergifybinarycovers the full CLI surface and clap handles unknown-subcommand
suggestions natively. Drop the whole Python superstructure in
one self-consistent change so CI doesn't briefly target a
half-deleted tree.
Deletions:
mergify_cli/— entire Python package (utils, cli, dym,exit_codes, github_types, stack/cli, init, main,
__globals + the test suite). All functionality was already
mirrored in the Rust crates; tests live alongside the Rust
code they exercise (~600 tests across the workspace).
crates/mergify-py-shim/— the subprocess bridge thatforwarded un-ported subcommands to Python. No un-ported
subcommands left.
compat-tests/—pytestrunner that diff'd Python vs.Rust output via
python -m mergify_cli. No Python side todiff against.
test_binary_build.py— verified the Python-specificWindows UTF-8 re-exec in
cli.py::main. The Rust binaryhandles UTF-8 natively, so the test target no longer exists.
poe.toml+requirements-uv.txt— Python toolchainpinning, irrelevant now.
Modifications:
pyproject.toml:dependencies(httpx, click, rich, pydantic, …) and[dependency-groups] dev(mypy, ruff, pytest, …) — wheelhas no Python runtime / no Python lint+test.
[tool.maturin]python-source+module-namesothe wheel doesn't try to bundle a package that's gone.
[tool.pytest.ini_options],[tool.mypy],[tool.ruff](long config block) — no Python to configure.bindings = "bin"+manifest-pathso maturin stillbuilds a binary-only wheel for PyPI.
requires-pythonto>=3.10— only matters for themetadata-side
pip installresolution, not the runtime.crates/mergify-cli/Cargo.toml— dropmergify-py-shimdep.crates/mergify-cli/src/main.rs:run_py_shim,inject_global_flags,prepend_one, andDispatch::Shimare gone. The
Dispatchenum kept as a single-variantwrapper so the match in
mainstays exhaustive.dispatch_stackno longer takesdebug(was only used bythe shim re-injection) and its
_fallback exits via asynthetic
StackProbeCliclap parse — that's what givesstack pusshclap's "did you meanpush,squash?"formatting natively.
via
clap::Error::exit(), surfacing the same Levenshteinsuggestions for unknown top-level subcommands (
staack→ "did you mean
stack?").shimmed_dispatch_*deleted — the shim is goneand clap's exit-on-error path can't be unit-tested without
subprocess plumbing.
.github/workflows/ci.yaml— droplinters,compat-tests,testjobs (Python lint/test). Keeprust(cargo) +wheels(build matrix) + a newsmoke-test-binaryjob thatpip installs each per-target wheel and runsmergify --helpto catch a broken wheel entry on every supported OS..github/workflows/func-tests-live.yaml— replaceuv run --locked poe live-testwithpip install --user pytest && python -m pytest -v func-tests/ -m liveso thelive smoke runs without the poe/uv-deps superstructure.
NATIVE_COMMANDS— add("stack", "push")(was missing).End state: the wheel is one Rust binary + LICENSE; clap covers
the full CLI; PyPI publishing pipeline unchanged.
Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com
Depends-On: #1553