Skip to content

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

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

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

Conversation

@jd

@jd jd commented Jun 4, 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: #1551

@jd

jd commented Jun 4, 2026

Copy link
Copy Markdown
Member Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 feat(rust): port stack push end-to-end + delete Python push.py #1551
2 chore: delete Python tree + simplify wheel/CI for pure-Rust binary #1547 👈

@mergify

mergify Bot commented Jun 4, 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,})

@jd jd force-pushed the devs/jd/feat/rust-stack-detect-change-type/delete-python-tree-simplify-wheel-ci-pure-rust--04684089 branch from 6cf9d2e to 0aa9017 Compare June 4, 2026 16:02
@jd

jd commented Jun 4, 2026

Copy link
Copy Markdown
Member Author

Revision history

# Type Changes Reason Date
1 initial 6cf9d2e 2026-06-04 16:03 UTC
2 content 6cf9d2e → 0aa9017 (raw) fix smoke-test-binary: build the wheel locally with maturin instead of downloading wheels-job artifacts, which only exist in release mode 2026-06-04 16:03 UTC
3 rebase 0aa9017 → dcf2520 (rebase only) 2026-06-05 06:33 UTC

@jd jd temporarily deployed to func-tests-live June 4, 2026 16:03 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live June 4, 2026 16:03 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections June 4, 2026 16:03 Failure
@mergify mergify Bot requested a review from a team June 4, 2026 16:08
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-detect-change-type/delete-python-tree-simplify-wheel-ci-pure-rust--04684089 branch from 0aa9017 to dcf2520 Compare June 5, 2026 06:33
@jd jd changed the base branch from devs/jd/feat/rust-stack-detect-change-type/wire-native-stack-push-delete-python-push-py--b8df6cd1 to devs/jd/feat/rust-stack-detect-change-type/port-stack-push-end-end-delete-python-push-py--1b2c3050 June 5, 2026 06:33
@jd jd temporarily deployed to func-tests-live June 5, 2026 06:33 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections June 5, 2026 06:34 Failure
@jd

jd commented Jun 5, 2026

Copy link
Copy Markdown
Member Author

Superseded by #1554 — restructured into a single-branch stack via mergify stack.

@jd jd closed this Jun 5, 2026
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