Skip to content

Python release workflow - #1822

Open
spacebear21 wants to merge 5 commits into
payjoin:masterfrom
spacebear21:python-release-workflow
Open

Python release workflow#1822
spacebear21 wants to merge 5 commits into
payjoin:masterfrom
spacebear21:python-release-workflow

Conversation

@spacebear21

Copy link
Copy Markdown
Collaborator

Builds on top of #1819

Add trusted publishing release workflow for Python bindings.

Co-authored by Claude Fable 5

Pull Request Checklist

Please confirm the following before requesting review:

@coveralls

coveralls commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 32275589660

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage remained the same at 86.718%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 16458
Covered Lines: 14272
Line Coverage: 86.72%
Coverage Strength: 343.45 hits per line

💛 - Coveralls

@spacebear21
spacebear21 force-pushed the python-release-workflow branch 2 times, most recently from d4ab07a to 7d8b2e8 Compare August 19, 2026 16:15
The two per-target cargo builds run in the background and were
reaped with a bare `wait`, which always returns zero no matter how
the children exited. Under `set -e` a failed build therefore fell
through to lipo, which would reuse a stale library from an earlier
build if one was present. Wait on each build's PID so either
failure stops the script.
The script hardcoded --profile dev and --features _test-utils, each
annotated with a reminder that a real release must not ship the test
utils feature. Adopt the PAYJOIN_FFI_FEATURES / PAYJOIN_FFI_PROFILE
convention the C# generate_bindings.sh already uses: features default
to _test-utils and the profile to dev, so tests behave exactly as
before, while a release build sets PAYJOIN_FFI_FEATURES= and
PAYJOIN_FFI_PROFILE=release to get an optimized library with no
test-only APIs.
contrib/build-wheel.sh builds the production wheel into dist/ from
the maintained recent lockfile, mirroring how contrib/test.sh drives
the test build: release profile, no _test-utils, then uv build.

contrib/test.sh now clears dist/ before building its wheel: the
release wheel carries different tags than the test build, so a
leftover copy would otherwise sit beside the fresh wheel and break
the install step's glob.
Add the tag-gated publishing path to the Python workflow, mirroring
the NuGet flow in csharp.yml: every run builds the release wheels
(manylinux x86_64 and macOS universal2) and smoke-installs them on
Linux, arm64 macOS, and Intel macOS with a CPython other than the
one they were built with, proving the py3-none retag. Pushing a
payjoin-python-<version> tag reruns the graph at the tagged commit,
then publishes the smoke-tested wheels to PyPI and attaches them to
the GitHub release.
The wheel advertised build, setuptools, wheel, semantic-version, and
typing-extensions as exact-pinned runtime requirements, though the
package imports none of them: the generated bindings use only the
standard library and http.py needs httpx.
@spacebear21
spacebear21 force-pushed the python-release-workflow branch from 7d8b2e8 to 040f2cf Compare August 19, 2026 16:22
@spacebear21
spacebear21 marked this pull request as ready for review August 19, 2026 16:25

@benalleng benalleng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

TACK 040f2cf

I wonder why we ended up with those deps in the first place? I was fairly certain there was at some point a need for them...?

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.

3 participants