spoke-connect (Python)
PyPI package spoke-connect: SPOKE Connect session-core bindings (generated uniffi Python + native spoke_connect / libspoke_connect).
Packaging contract: connect-binding-channels.md §3.3.
Install
At spoke lockstep tag vX.Y.Z:
pip install spoke-connect==X.Y.Z
Platform wheels (py3-none-<platform>) ship for manylinux_2_35_x86_64, macosx_11_0_arm64, and win_amd64. Each wheel bundles that platform's shared library beside the spoke_connect module (uniffi ctypes loader contract). Version locksteps with the spoke monorepo SemVer / git tag vX.Y.Z.
Release publishes via Trusted Publishing on the top-level release.yml workflow (publish-pypi job, OIDC). The PyPI Pending publisher for spoke-connect binds repository 42ch-dev/spoke to that workflow filename; the first successful stable-tag publish activates the project on PyPI.
Usage
import spoke_connect
peer_id = spoke_connect.derive_peer_id_from_ed25519_pubkey(pubkey)
protocol = spoke_connect.protocol_version() # 1
Transport / WebSocket stays in the host product.
Build features
| Artifact | Cargo features | Notes |
|---|---|---|
Committed spoke_connect/ |
ffi,remote-adapter |
Production surface: RemoteAdapterFFI, Transport, loopback_transport_pair — no start_loopback_smoke_host |
| Local loopback smoke cdylib + bindings | ffi,remote-adapter,ffi-smoke-host |
Adds loopback smoke host FFI for the RemoteAdapter section |
ffi-smoke-host is non-default and is not implied by remote-adapter or ffi.
Full loopback smoke procedure: Smoke/README.md.
Layout
| Path | Contents |
|---|---|
pyproject.toml |
Packable project (name = spoke-connect; lockstep SemVer) |
setup.py |
Platform wheel tag hook (py3-none-<platform>; no sdist) |
spoke_connect/ |
Import package — committed generated __init__.py + host native for smoke |
native/ |
Staging contract for non-host RIDs (see native/README.md) |
Smoke/ |
Golden-parity + RemoteAdapter loopback smoke — see Smoke/README.md |
Maintainer: regenerate → stage native → wheel → smoke
Commands from the repository root (local nightly convention for cargo: cargo +nightly …).
Production regenerate uses ffi,remote-adapter only (no ffi-smoke-host). Full loopback smoke
recipe: Smoke/README.md.
# 1. Build the production ffi cdylib (must run before generate — default build replaces the stub)
cargo +nightly build -p spoke-connect --features ffi,remote-adapter --release
# 2. Generate bindings (first-party uniffi 0.32)
cargo +nightly run -p spoke-connect --features ffi,bindgen-cli,remote-adapter --bin uniffi-bindgen -- \
generate --library target/release/libspoke_connect.dylib \
--language python --out-dir crates/spoke-connect/bindings/python/spoke_connect
mv crates/spoke-connect/bindings/python/spoke_connect/spoke_connect.py \
crates/spoke-connect/bindings/python/spoke_connect/__init__.py
# 3. Stage host native beside the module (darwin arm64 example)
cp target/release/libspoke_connect.dylib \
crates/spoke-connect/bindings/python/spoke_connect/
install_name_tool -id @rpath/libspoke_connect.dylib \
crates/spoke-connect/bindings/python/spoke_connect/libspoke_connect.dylib
# 4. Golden-parity smoke (no wheel required)
PYTHONPATH=crates/spoke-connect/bindings/python \
python3 -m unittest discover -s crates/spoke-connect/bindings/python/Smoke -v
# 5. Build platform wheel (host RID or CI artifact — recipe: tooling/connect/build-python-wheel.sh)
./tooling/connect/build-python-wheel.sh
# Release: all three wheels from build-connect-ffi artifacts
./tooling/connect/build-python-wheels-from-ffi.sh ffi-assembled
v1 publishes platform wheels only (no sdist): a source install cannot produce the native library without a Rust toolchain.
Committed natives (in-tree smoke)
| Wheel platform (PEP 425) | Native | Status |
|---|---|---|
macosx_11_0_arm64 |
spoke_connect/libspoke_connect.dylib |
Committed — maintainer-built (release) |
manylinux_2_35_x86_64 |
libspoke_connect.so |
CI — stage from release.yml build-connect-ffi (linux-x64, ubuntu-22.04) before wheel build |
win_amd64 |
spoke_connect.dll |
CI — stage from build-connect-ffi (win-x64) before wheel build |
Reference
- Wheel recipe:
tooling/connect/build-python-wheel.sh - Release wheels (all RIDs):
tooling/connect/build-python-wheels-from-ffi.sh - Pre-publish inventory gate:
tooling/connect/verify-python-wheels.sh - FFI surface:
../../src/ffi.rs - Publish strategy: connect-publish-strategy.md
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spoke_connect-0.9.0-py3-none-win_amd64.whl.
File metadata
- Download URL: spoke_connect-0.9.0-py3-none-win_amd64.whl
- Upload date:
- Size: 2.8 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d97ea0a68e2e39f5d3a96b6680250dea97d13daa8c5b859edb1fb7a148e22a2
|
|
| MD5 |
eebb220347f0bc76d0cb7875f7b998f1
|
|
| BLAKE2b-256 |
ebaa611cda175a2c932ded4b62b858f695e465a98e373e287f104ad2caf78c91
|
Provenance
The following attestation bundles were made for spoke_connect-0.9.0-py3-none-win_amd64.whl:
Publisher:
release.yml on 42ch-dev/spoke
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spoke_connect-0.9.0-py3-none-win_amd64.whl -
Subject digest:
2d97ea0a68e2e39f5d3a96b6680250dea97d13daa8c5b859edb1fb7a148e22a2 - Sigstore transparency entry: 2358371433
- Sigstore integration time:
-
Permalink:
42ch-dev/spoke@a502c8898203fa6b34c49c0f80a56f76af7b4bd1 -
Branch / Tag:
refs/tags/v0.9.0 - Owner: https://github.com/42ch-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a502c8898203fa6b34c49c0f80a56f76af7b4bd1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file spoke_connect-0.9.0-py3-none-manylinux_2_35_x86_64.whl.
File metadata
- Download URL: spoke_connect-0.9.0-py3-none-manylinux_2_35_x86_64.whl
- Upload date:
- Size: 1.5 MB
- Tags: Python 3, manylinux: glibc 2.35+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7409412231f2a857447b0c5d478f6b6de60954477e05c690b9e49da2579d6a33
|
|
| MD5 |
9566e8a0d99380f3d866133620d60811
|
|
| BLAKE2b-256 |
25bb630967bb5454406aa8da51281c25f43ea07dbb2c20352234ccb5a99b8de9
|
Provenance
The following attestation bundles were made for spoke_connect-0.9.0-py3-none-manylinux_2_35_x86_64.whl:
Publisher:
release.yml on 42ch-dev/spoke
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spoke_connect-0.9.0-py3-none-manylinux_2_35_x86_64.whl -
Subject digest:
7409412231f2a857447b0c5d478f6b6de60954477e05c690b9e49da2579d6a33 - Sigstore transparency entry: 2358371500
- Sigstore integration time:
-
Permalink:
42ch-dev/spoke@a502c8898203fa6b34c49c0f80a56f76af7b4bd1 -
Branch / Tag:
refs/tags/v0.9.0 - Owner: https://github.com/42ch-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a502c8898203fa6b34c49c0f80a56f76af7b4bd1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file spoke_connect-0.9.0-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: spoke_connect-0.9.0-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.0 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
829c0cb25d90c1751398bb98055bdc7d52bd19f5650ff20653f6db16dbd8f3da
|
|
| MD5 |
247141a6710a9b9ea4285f6ab629fa0a
|
|
| BLAKE2b-256 |
06f466fefb76500a4342802027b006d37733fe0ef5f31a2409fd1179e9dd3525
|
Provenance
The following attestation bundles were made for spoke_connect-0.9.0-py3-none-macosx_11_0_arm64.whl:
Publisher:
release.yml on 42ch-dev/spoke
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spoke_connect-0.9.0-py3-none-macosx_11_0_arm64.whl -
Subject digest:
829c0cb25d90c1751398bb98055bdc7d52bd19f5650ff20653f6db16dbd8f3da - Sigstore transparency entry: 2358371469
- Sigstore integration time:
-
Permalink:
42ch-dev/spoke@a502c8898203fa6b34c49c0f80a56f76af7b4bd1 -
Branch / Tag:
refs/tags/v0.9.0 - Owner: https://github.com/42ch-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a502c8898203fa6b34c49c0f80a56f76af7b4bd1 -
Trigger Event:
push
-
Statement type: