Skip to content

Bundle the gen CLI client in the Python wheel - #226

Open
bobvh wants to merge 3 commits into
mainfrom
pip-client
Open

Bundle the gen CLI client in the Python wheel#226
bobvh wants to merge 3 commits into
mainfrom
pip-client

Conversation

@bobvh

@bobvh bobvh commented Jul 30, 2026

Copy link
Copy Markdown
Member

Stages the release Rust binary into maturin's wheel data scripts directory so pip, uv, and pipx installs put gen on PATH alongside the Python bindings.

  • make stage-python-client builds the binary and copies it into gen.gen.data/scripts/
  • Wheel builds on macOS, Linux, and Windows stage the client before packaging
  • gen-python/scripts/verify_wheel.py checks the built wheel contains the client, the compiled extension, and the Jupyter widget asset
  • CI installs the built wheel and runs gen --version as a smoke test
  • README / gen-python README updated to describe the bundled client and new make python-wheel target

Also includes a temporary [patch.crates-io] pin of rusqdoltlite to an unpublished fix-windows branch (bobvh/rusqdoltlite@d1ef39b) — without it, cargo build --bin gen fails on Windows under MSVC (pthread_t/DoltliteServer parse failure in the bundled remote-auth server). Revert once the fix ships on crates.io.

Also bumps spin to 0.9.9 to resolve a yanked-crate warning from cargo-deny.

Stacked PR 1/5: pip-client → pip-abi3 → pip-targets → pip-publish-gating → pip-apple-signing

bobvh added 3 commits July 30, 2026 20:23
Stage the release Rust binary into maturin's wheel data scripts
directory so pip, uv, and pipx installs put `gen` on PATH alongside
the Python bindings. Adds a verify_wheel.py check and a smoke test
that installs the built wheel and runs `gen --version` in CI.
…tion

Points at bobvh/rusqdoltlite@d1ef39b (fix-windows branch), which excludes
Windows from the bundled remote-auth server build to avoid the
pthread_t/struct DoltliteServer parse failure under MSVC. Without this,
cargo build --bin gen fails on Windows because default features enable
"remote". Revert this patch once the fix ships in a published crates.io
release.
Resolves a yanked-crate warning surfaced by cargo-deny.
with:
command: build
args: --release --manifest-path gen-python/Cargo.toml --features extension-module --interpreter python${{ matrix.python-version }} --out gen-python/target/wheels
sccache: true

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this failing?

working-directory: .
- name: Verify wheel contents (macOS, Linux)
if: runner.os != 'Windows'
run: python gen-python/scripts/verify_wheel.py gen-python/target/wheels/*.whl

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't really get the point of a verify_wheel script, what are we trying to keep track of?

@@ -0,0 +1,47 @@
#!/usr/bin/env python3
"""Verify that a Gen wheel contains the Python package and bundled client."""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't really do a meaningful test. It's like validating a mock you wrote. Meaningful test is verifying it installs + is importable + is a callable binary.

Comment thread Makefile
@[ -d .venv ] || python -m venv .venv
@.venv/bin/pip show maturin >/dev/null 2>&1 || .venv/bin/pip install maturin
.venv/bin/maturin develop --release --manifest-path gen-python/Cargo.toml --features extension-module
stage-python-client:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it called stage-python-client?

Comment thread README.md

## Install

**Gen client**: prebuilt binaries for macOS and Linux are on the [releases page](https://github.com/genhub-bio/gen/releases): [macOS (.pkg)](https://github.com/genhub-bio/gen/releases/download/nightly/gen.macos.pkg), [Linux x86_64 (.zip)](https://github.com/genhub-bio/gen/releases/download/nightly/gen.linux-x86_64.zip), [Linux arm64 (.zip)](https://github.com/genhub-bio/gen/releases/download/nightly/gen.linux-arm64.zip). Gen is built primarily for Unix-like systems; on Windows, you can install [WSL](https://learn.microsoft.com/en-us/windows/wsl/) to get a Linux environment, then use the Linux binary above from inside it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd prefer to keep the binary stuff at the top -- imo that's the easiest way to install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants