Commit 5fce67b
chore: delete Python tree + simplify wheel/CI for pure-Rust binary (#1554)
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>1 parent 0f91ee4 commit 5fce67b
43 files changed
Lines changed: 233 additions & 3472 deletions
File tree
- .github/workflows
- compat-tests
- cases
- bad-subcommand
- help
- stack-help
- version
- crates
- mergify-cli
- src
- mergify-py-shim
- src
- mergify_cli
- stack
- tests
- stack
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | 11 | | |
62 | 12 | | |
63 | 13 | | |
| |||
84 | 34 | | |
85 | 35 | | |
86 | 36 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
94 | 59 | | |
| 60 | + | |
95 | 61 | | |
96 | 62 | | |
97 | | - | |
98 | 63 | | |
99 | 64 | | |
100 | 65 | | |
101 | 66 | | |
102 | 67 | | |
103 | | - | |
104 | | - | |
| 68 | + | |
105 | 69 | | |
106 | 70 | | |
107 | 71 | | |
108 | 72 | | |
109 | 73 | | |
110 | 74 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 75 | + | |
| 76 | + | |
129 | 77 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | 78 | | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
143 | 82 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
173 | 87 | | |
174 | 88 | | |
175 | 89 | | |
176 | 90 | | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | 91 | | |
181 | 92 | | |
| 93 | + | |
182 | 94 | | |
183 | 95 | | |
184 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
0 commit comments