build: prepare v0.2.0 for crates.io + PyPI distribution (rename lemma-rs / lemma-lean) - #1
Merged
Merged
Conversation
The pivot to a pure toolchain manager (removing build/init/run) changed the CLI surface significantly, so bump the workspace 0.1.5 -> 0.2.0 and make the whole workspace publishable for the first time since the pivot. Rename for available registry names (verified 2026-08-03): - crates.io `lemma` is taken by an unrelated active project, so the binary crate `lemma` -> `lemma-rs`, resuming our own previously published crate (0.1.5, 2025-11). The executable stays `lemma` via [[bin]] name. - `lemma-cli` -> `lemma-args` (also taken); directory renamed to match and all `lemma_cli` imports updated to `lemma_args`. - PyPI `lemma` is taken, so the Python package is renamed `lemma` -> `lemma-lean` in pyproject.toml (maturin bin binding unchanged). Make `cargo publish` work: - Add `version = "0.2.0"` to every internal workspace dependency (they were path-only, which cargo rejects when packaging). - Align `lemma-static` on the workspace version (was pinned 0.1.0). - Move the integration test suite from the workspace-root `tests/` into `crates/lemma-rs/tests/` so the published crate no longer references a `../../tests` path outside its package root. cd.yml: rewrite to publish all 9 crates in topological dependency order (static/platform/output -> toolchain -> config -> args -> download -> install -> lemma-rs), skipping anything already published so a re-run after a partial failure is safe, with a short pause for sparse-index propagation. User-facing install guidance (README, README_CN, `lemma self update`, `lemma self uninstall`, help text) now points at `pipx install lemma-lean` and `cargo install lemma-rs` instead of the squatted `lemma` names.
The integration suite located the `lemma` binary by walking up from
`env::current_exe()` and guessing `target/debug/lemma`. That broke on the
nightly toolchain used by CI: nightly places the integration test binary
under `target/debug/build/lemma-rs/<hash>/out/` instead of
`target/debug/deps/`, so `current_exe().parent().parent()` no longer lands in
`target/debug` and every integration test failed with
`Os { code: 2, kind: NotFound }` (Test Suite + Code Coverage jobs).
Use `env!("CARGO_BIN_EXE_lemma")` instead. Cargo sets it to the absolute path
of the binary it builds for the integration test and guarantees that binary is
built before the test runs, so it is correct regardless of toolchain, profile,
or `--target-dir` (the coverage job uses a custom one).
Verified on nightly from a clean build:
cargo +nightly test --locked --all-features --workspace -> 129 passed, 0 failed
cargo +nightly fmt --check / clippy -D warnings -> clean
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
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.
Summary
Prepares Lemma for its first distribution since the pivot to a pure toolchain manager: renames packages to available registry names, bumps the workspace to 0.2.0, makes the whole workspace publishable, and rewrites the crates.io publish workflow.
Part of W-153 (lemma 分发修复). After this merges, the remaining steps require account/secret access (see "Follow-up (needs maintainer)" below).
Why the renames
lemmalemma-rslemma-clitakenlemma-argslemma-leanThe command-line executable stays
lemmain every case ([[bin]] name = "lemma"for cargo; maturinbindings = "bin"for the wheel).Changes
Version + publishability
0.1.5→0.2.0;lemma-staticaligned to the workspace version (was pinned0.1.0).version = "0.2.0"(they were path‑only, whichcargo publishrejects).lemma→lemma-rs;lemma-cli→lemma-args(directory renamed, alllemma_cliimports →lemma_args).tests/intocrates/lemma-rs/tests/so the published crate no longer references a../../testspath outside its package root (this blockedcargo package).cd.yml
lemma-static,lemma-platform,lemma-output→lemma-toolchain→lemma-config→lemma-args→lemma-download→lemma-install→lemma-rs.lemma-configdepends onlemma-toolchain, so they are ordered (not parallel) — corrected vs. the original plan.pyproject.toml
name = "lemma"→"lemma-lean",version→0.2.0. maturinmanifest-path = "crates/lemma-rs/Cargo.toml"andbindings = "bin"unchanged.User-facing install guidance
lemma self update,lemma self uninstall, and help text now point atpipx install lemma-leanandcargo install lemma-rs(previously they told users to install/upgrade the squattedlemmaname — i.e. the wrong package).lemma-lean.Verification (local)
cargo build --workspace✅cargo test --workspace✅ (129 passed, 0 failed; the 53 integration tests run from the new in-crate location)cargo fmt --all --check✅ andcargo clippy --all-targets --all-features --workspace -- -D warnings✅cargo docwith-D warnings✅cargo package -p lemma-static/-p lemma-platform✅ (no-dep crates package cleanly; dependent crates correctly resolve their internal deps against the registry, which populate once published in order)maturin build --locked→lemma_lean-0.2.0-*.whl; installed into a clean venv →lemma --versionprintslemma 0.2.0✅lemma self updatenow printspipx upgrade lemma-lean/cargo install lemma-rs --force✅lemma-rs@0.1.5exists (ours to resume),lemma-args@0.2.0andlemma-rs@0.2.0are free ✅Follow-up (needs maintainer — accounts/secrets, not code)
CARGO_REGISTRY_TOKENis set and the account ownslemma-rs; run thecd.ymlworkflow (or I can, once merged).lemma-leanand add a pending trusted publisher — ownerLeanOxide, repolemma, workflowrelease.yml, environment blank. (Fallback:PYPI_API_TOKENsecret.)v0.2.0+ create a GitHub release to triggerrelease.yml(5‑platform wheels + sdist → release assets + PyPI). Happy to tag on request.pipx install lemma-lean && lemma --version,cargo install lemma-rs && lemma --version,lemma toolchain install stable && lemma show.Suggested later (out of scope here)
description/homepagemetadata (cargo warns "manifest has no description" during packaging; cosmetic, does not block publishing).release.ymlonly produces wheel/sdist).