Skip to content

chore: delete Python tree + simplify wheel/CI for pure-Rust binary#1554

Open
jd wants to merge 1 commit into
devs/jd/feat/rust-stack-new/port-stack-push-end-end-delete-python-push-py--1b2c3050from
devs/jd/feat/rust-stack-new/delete-python-tree-simplify-wheel-ci-pure-rust--04684089
Open

chore: delete Python tree + simplify wheel/CI for pure-Rust binary#1554
jd wants to merge 1 commit into
devs/jd/feat/rust-stack-new/port-stack-push-end-end-delete-python-push-py--1b2c3050from
devs/jd/feat/rust-stack-new/delete-python-tree-simplify-wheel-ci-pure-rust--04684089

Conversation

@jd

@jd jd commented Jun 5, 2026

Copy link
Copy Markdown
Member

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 installs 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

Depends-On: #1553

@jd

jd commented Jun 5, 2026

Copy link
Copy Markdown
Member Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 feat(rust): port stack checkout to native Rust #1522
2 feat(rust): port stack sync to native Rust #1523
3 feat(rust): port stack list + stack open to native Rust #1524
4 feat(rust): port stack hooks + stack setup to native Rust #1527
5 feat(rust): port stack push end-to-end + delete Python push.py #1553
6 chore: delete Python tree + simplify wheel/CI for pure-Rust binary #1554 👈
7 refactor(stack): extract shared git helpers into crate::git #1555
8 ci(workflows): align smoke-test-binary on python 3.14 #1557

@mergify

mergify Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🔴 ⛓️ Depends-On Requirements

Waiting for

This rule is failing.

Requirement based on the presence of Depends-On in the body of the pull request

🔴 👀 Review Requirements

Waiting for

  • #approved-reviews-by>=2
This rule is failing.
  • any of:
    • #approved-reviews-by>=2
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🔴 🔎 Reviews

Waiting for

  • #review-requested = 0
This rule is failing.
  • #review-requested = 0
  • #changes-requested-reviews-by = 0
  • #review-threads-unresolved = 0

🟢 🤖 Continuous Integration

Wonderful, this rule succeeded.
  • all of:
    • check-success=ci-gate

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?:

🟢 📕 PR description

Wonderful, this rule succeeded.
  • body ~= (?ms:.{48,})

Comment thread .github/workflows/func-tests-live.yaml Outdated
@jd jd marked this pull request as ready for review June 5, 2026 07:43
@jd jd force-pushed the devs/jd/feat/rust-stack-new/port-stack-push-end-end-delete-python-push-py--1b2c3050 branch from 0ed6917 to 9767f5b Compare June 5, 2026 08:13
@jd jd force-pushed the devs/jd/feat/rust-stack-new/delete-python-tree-simplify-wheel-ci-pure-rust--04684089 branch from 0aed310 to 33f2759 Compare June 5, 2026 08:13
@jd jd temporarily deployed to func-tests-live June 5, 2026 08:13 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live June 5, 2026 08:13 — with GitHub Actions Inactive
@jd

jd commented Jun 5, 2026

Copy link
Copy Markdown
Member Author

Revision history

# Type Changes Reason Date
1 initial 0aed310 2026-06-05 08:13 UTC
2 rebase 0aed310 → 33f2759 (rebase only) 2026-06-05 08:13 UTC
3 content 33f2759 → fdab609 2026-06-05 09:38 UTC
4 content fdab609 → e373ef9 (raw) address jd's review: revert unintentional python-version downgrade from 3.14 to 3.13 in func-tests-live.yaml (was copy-pasted from ci.yaml's smoke-test-binary job; no reason to change here) 2026-06-05 11:15 UTC
5 rebase e373ef9 → 341abdb (rebase only) 2026-06-05 12:37 UTC
6 content 341abdb → 34a48aa (raw) 2026-06-08 11:31 UTC
7 rebase 34a48aa → d69a6fb (rebase only) 2026-06-08 15:03 UTC

@mergify mergify Bot had a problem deploying to Mergify Merge Protections June 5, 2026 08:13 Failure
@jd jd force-pushed the devs/jd/feat/rust-stack-new/delete-python-tree-simplify-wheel-ci-pure-rust--04684089 branch from 33f2759 to fdab609 Compare June 5, 2026 09:38
@jd jd force-pushed the devs/jd/feat/rust-stack-new/port-stack-push-end-end-delete-python-push-py--1b2c3050 branch from 9767f5b to bcaa5fa Compare June 5, 2026 09:38
@jd jd temporarily deployed to func-tests-live June 5, 2026 09:38 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live June 5, 2026 09:38 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live June 5, 2026 09:38 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections June 5, 2026 09:39 Failure
@jd jd force-pushed the devs/jd/feat/rust-stack-new/delete-python-tree-simplify-wheel-ci-pure-rust--04684089 branch from fdab609 to e373ef9 Compare June 5, 2026 11:15
@jd jd temporarily deployed to func-tests-live June 5, 2026 11:15 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live June 5, 2026 11:15 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections June 5, 2026 11:15 Failure
@jd jd force-pushed the devs/jd/feat/rust-stack-new/port-stack-push-end-end-delete-python-push-py--1b2c3050 branch from bcaa5fa to f74c92d Compare June 5, 2026 12:37
@jd jd force-pushed the devs/jd/feat/rust-stack-new/delete-python-tree-simplify-wheel-ci-pure-rust--04684089 branch from e373ef9 to 341abdb Compare June 5, 2026 12:37
@jd jd temporarily deployed to func-tests-live June 5, 2026 12:37 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections June 5, 2026 12:37 Failure
@jd jd force-pushed the devs/jd/feat/rust-stack-new/port-stack-push-end-end-delete-python-push-py--1b2c3050 branch from f74c92d to 8a1fd6c Compare June 8, 2026 11:31
@jd jd force-pushed the devs/jd/feat/rust-stack-new/delete-python-tree-simplify-wheel-ci-pure-rust--04684089 branch from 341abdb to 34a48aa Compare June 8, 2026 11:31
@jd jd temporarily deployed to func-tests-live June 8, 2026 11:31 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live June 8, 2026 11:31 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live June 8, 2026 11:31 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections June 8, 2026 11:31 Failure
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
@jd jd force-pushed the devs/jd/feat/rust-stack-new/delete-python-tree-simplify-wheel-ci-pure-rust--04684089 branch from 34a48aa to d69a6fb Compare June 8, 2026 15:02
@jd jd force-pushed the devs/jd/feat/rust-stack-new/port-stack-push-end-end-delete-python-push-py--1b2c3050 branch from 8a1fd6c to 1a27b20 Compare June 8, 2026 15:03
@jd jd temporarily deployed to func-tests-live June 8, 2026 15:03 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live June 8, 2026 15:03 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections June 8, 2026 15:03 Failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant