Skip to content

Prepare Python wheel releases - #1041

Open
tnull wants to merge 6 commits into
lightningdevkit:mainfrom
tnull:2026-08-python-wheels
Open

Prepare Python wheel releases#1041
tnull wants to merge 6 commits into
lightningdevkit:mainfrom
tnull:2026-08-python-wheels

Conversation

@tnull

@tnull tnull commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Build Python-ABI-independent wheels for supported Linux and macOS targets so users can install LDK Node directly from PyPI.

Keep build and publication available through local scripts. Require the complete artifact set on TestPyPI before production, and exercise the bindings on the oldest and newest supported CPython versions.

@tnull
tnull requested a review from valentinewallace August 11, 2026 14:25
@ldk-reviews-bot

ldk-reviews-bot commented Aug 11, 2026

Copy link
Copy Markdown

👋 Thanks for assigning @tankyleo as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@valentinewallace

Copy link
Copy Markdown
Contributor

This is pretty outside of my wheelhouse (ba dum tiss), and I was planning to sink a lot of my review bandwidth into https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/4872 in the coming days, so FYI my first impression is that it may take me a little while to get to this and then take a while to get up to speed on it.

@tnull
tnull force-pushed the 2026-08-python-wheels branch from d2af3f8 to dbe8999 Compare August 13, 2026 07:12
@tnull
tnull requested review from tankyleo and removed request for valentinewallace August 13, 2026 07:12
@tnull tnull added this to the 0.8 milestone Aug 13, 2026
@tnull

tnull commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator Author

This is pretty outside of my wheelhouse (ba dum tiss), and I was planning to sink a lot of my review bandwidth into https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/4872 in the coming days, so FYI my first impression is that it may take me a little while to get to this and then take a while to get up to speed on it.

Okay. Now reassigned @tankyleo as we'll need this for next week's release (worst case I just run the updated scripts locally without prior review).

Rebased after #1040 landed.

@tnull
tnull force-pushed the 2026-08-python-wheels branch from dbe8999 to 8fffe35 Compare August 13, 2026 07:21
tankyleo
tankyleo previously approved these changes Aug 14, 2026
Comment thread scripts/python_build_wheel.sh Outdated
echo "Building Python wheel from commit $(git rev-parse HEAD)"
echo "Target: $(uname -s) $(uname -m)"

uv tool run --from "cibuildwheel[uv]==$CIBUILDWHEEL_VERSION" cibuildwheel \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Had codex do a full dress rehearsal, it came up with this, but seems low priority so feel free to dismiss:

commit a81dff8cd9864b68dc4506f086de18987adb9bc8
Author: Leo Nash <hello@leonash.net>
Date:   Fri Aug 14 00:57:22 2026 +0000

    Select Python 3.11 for cibuildwheel

    cibuildwheel 4.1 requires Python 3.11 or newer. When uv selected
    Python 3.10, the wheel build failed before Docker could start.

    Select Python 3.11 explicitly so uv installs a compatible interpreter
    and the release build works when Python 3.10 is the default.

    AI-Assisted-By: OpenAI Codex

diff --git a/scripts/python_build_wheel.sh b/scripts/python_build_wheel.sh
index 56ee4678..4b1337b6 100755
--- a/scripts/python_build_wheel.sh
+++ b/scripts/python_build_wheel.sh
@@ -127,7 +127,7 @@ trap cleanup EXIT
 echo "Building Python wheel from commit $(git rev-parse HEAD)"
 echo "Target: $(uname -s) $(uname -m)"

-uv tool run --from "cibuildwheel[uv]==$CIBUILDWHEEL_VERSION" cibuildwheel \
+uv tool run --python 3.11 --from "cibuildwheel[uv]==$CIBUILDWHEEL_VERSION" cibuildwheel \
        bindings/python \
        --config-file bindings/python/pyproject.toml \
        --output-dir "$OUTPUT_DIR"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks. Addressed this by amending.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sounds like the --python 3.11 flag is still missing from the uv tool run call ?

Build Python-ABI-independent wheels for supported Linux and macOS
targets so users can install LDK Node directly from PyPI.

Keep build and publication available through local scripts. Require the
complete artifact set on TestPyPI before production, and exercise the
bindings on the oldest and newest supported CPython versions.

Co-Authored-By: HAL 9000
@tnull

tnull commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator Author

Now also amended to allow building macOS x86_64 wheels on aarch64 macs.

@tnull
tnull requested a review from tankyleo August 14, 2026 09:02
Assisted-by: OpenAI Codex
cibuildwheel copies the repository into its Linux build container.
Ignored build outputs such as target/, virtual environments, and dist/
can make that context several gigabytes, slowing builds or exhausting
Docker storage.

Export tracked and non-ignored untracked files to a temporary source
directory before invoking cibuildwheel. This keeps ignored artifacts
out of the container context while preserving local changes for
--allow-dirty builds.

Assisted-by: OpenAI Codex
Match the Python wheel version to the Rust crate and intended release.

Assisted-by: OpenAI Codex
Declare the dual-license expression and package both canonical
license texts.

Assisted-by: OpenAI Codex
Track both lockfiles and require Cargo to use them while generating
Python wheel bindings.

Assisted-by: OpenAI Codex

@tankyleo tankyleo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pushed a couple of commits on top of your branch that came up after a few rounds with codex, feel free to drop and amend as needed.

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.

4 participants