Skip to main content

gwz-py

Python bindings and an installable gwz-py command for GWZ multi-repository workspaces.

Status: alpha. The Python package shape, generated taut protocol API, async client facade, CLI entry point, and native gwz-core bridge exist. The native bridge supports request/response calls plus operation event streaming for long-running operations such as clone, materialize, pull, and push. The nested repo surface is argv-compatible with Rust gwz for add, clone, create, detach, attach, and sync, including member/source id overrides and repo-clone dry-run behavior.

Release mode: installing the PyPI distribution gwz installs the Python gwz-py CLI (gwz.cli:main). The CLI uses the same native gwz-core extension as the Python API; first-line PyPI wheels do not bundle or dispatch to the Rust gwz binary.

python -m pip install gwz
python -m pip install -e ".[dev]"
python run_tests.py

Build the native extension locally with maturin:

python -m maturin develop
python -m pytest src/tests/test_native_bridge.py -q

Run the package smoke test before release-oriented changes. It builds a repaired wheel, installs it into a fresh virtualenv, runs gwz-py --help, creates a local workspace fixture, exercises installed gwz-py clone, verifies clone progress events and materialized member state, then runs gwz-py status in the clone:

python scripts/package_smoke.py

Check that the packaged protocol IR still matches the sibling gwz-core schema:

python scripts/check_protocol_drift.py

The native crate requires Rust 1.95 or newer and links the sibling ../gwz-core checkout during local development. gwz-core depends on git2 with HTTPS and SSH support, so source builds may need platform OpenSSL, libgit2, and SSH build prerequisites when wheels are not available.

CI validates macOS, Linux, and Windows. Windows source builds use the same native extension path as other platforms and need OpenSSL/libgit2 prerequisites available to Cargo, for example through vcpkg with VCPKG_ROOT set.

If gwz._gwz_core is missing, pass a custom bridge in tests or run python -m maturin develop from this directory.

Regenerate the protocol API from the sibling gwz-core checkout:

python scripts/regen_protocol.py
python scripts/regen_protocol.py --check

Example API shape:

from pathlib import Path

from gwz import Client


async with Client(root=Path(".")) as client:
    response = await client.status(combined=True)

Repository Member Lifecycle

The async client and gwz-py repo commands follow the same lifecycle contract as Rust gwz:

from pathlib import Path

from gwz import Client


async with Client(root=Path("/work/ws")) as client:
    await client.clone_repo_member(
        "git@github.com:org/shared.git",
        "libs/shared",
        member_id="mem_shared",
        source_id="src_shared",
    )
    await client.detach_repo_member("mem_shared")
    await client.attach_repo_member("mem_shared")

Use clone_repo_member_stream(...) instead of clone_repo_member(...) when the caller needs clone progress events. The corresponding CLI forms are gwz-py repo clone, gwz-py repo detach, and gwz-py repo attach; their positional arguments and member/source id options match Rust gwz.

detach_repo_member accepts exactly one active member id or workspace-relative path. attach_repo_member requires one literal historical member id. Their positional selector cannot be combined with selection keyword arguments in **meta.

Bare add_existing_repo can reactivate a detached row only when exactly one inactive row at the same path has a non-empty historical commit evidence set and every recorded commit exists locally. An explicit new member_id creates a new designation instead. Explicit attach with no recorded evidence succeeds with this exact warning:

attached <member_id>; no snapshot or marker commit evidence was available to verify repository identity

Attach, evidence-backed add, and reuse of an existing source_id fail with GwzErrorCode.source_identity_mismatch when any required snapshot or marker commit is missing. The native core does not fetch automatically; fetch sufficient history into shallow or incomplete repositories before retrying.

The Python API uses the gwz-core bridge. It must not shell out to the Rust gwz executable.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gwz-0.9.0.tar.gz (144.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

gwz-0.9.0-cp310-abi3-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.10+Windows x86-64

gwz-0.9.0-cp310-abi3-manylinux_2_39_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.39+ x86-64

gwz-0.9.0-cp310-abi3-manylinux_2_39_aarch64.whl (4.2 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.39+ ARM64

gwz-0.9.0-cp310-abi3-macosx_11_0_arm64.whl (4.6 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

gwz-0.9.0-cp310-abi3-macosx_10_12_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file gwz-0.9.0.tar.gz.

File metadata

  • Download URL: gwz-0.9.0.tar.gz
  • Upload date:
  • Size: 144.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gwz-0.9.0.tar.gz
Algorithm Hash digest
SHA256 6943d5f4d5dc4b8edf6b4d64012b0bd1ff75cb33b0e0b6d9eb43f3b606f2e3b4
MD5 ccda0f06f29e15b7ab7735bb34fc0bbe
BLAKE2b-256 4d2bf7a2ed013efed3d5f905fd6cdcccad135b1e9c4f3056ce514293cf52e2d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for gwz-0.9.0.tar.gz:

Publisher: publish.yml on owebeeone/gwz-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gwz-0.9.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: gwz-0.9.0-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gwz-0.9.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 51fb220b7e0c8d9ec321c4a4bd1047a1749606143dcb09e49a4e527cacb07588
MD5 fa3319950b3a7a70c17a32cf9716507b
BLAKE2b-256 ebf3f2d7cbc4f6562cfb7213c9e7c43da45b98d165fdd02b491d231dc63c62a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for gwz-0.9.0-cp310-abi3-win_amd64.whl:

Publisher: publish.yml on owebeeone/gwz-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gwz-0.9.0-cp310-abi3-manylinux_2_39_x86_64.whl.

File metadata

  • Download URL: gwz-0.9.0-cp310-abi3-manylinux_2_39_x86_64.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: CPython 3.10+, manylinux: glibc 2.39+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gwz-0.9.0-cp310-abi3-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 6090ee33fa9e0d29e81ed82f1dcd1ef697b8f4f2aff08dbb6e5485b49b90dbcf
MD5 6ac3a25fe2eef0051532b0e03ddd03de
BLAKE2b-256 0ba122d8269d7984c9b32c2cc3b4799c06586d0f505db6bb47dbcd6cf97af46c

See more details on using hashes here.

Provenance

The following attestation bundles were made for gwz-0.9.0-cp310-abi3-manylinux_2_39_x86_64.whl:

Publisher: publish.yml on owebeeone/gwz-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gwz-0.9.0-cp310-abi3-manylinux_2_39_aarch64.whl.

File metadata

File hashes

Hashes for gwz-0.9.0-cp310-abi3-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 b583f119426e82fcd27e6785a9bac04f321b347cdd57509172eff4de14f49ed4
MD5 90973ff7b05ee9dd86dffcb2d381df29
BLAKE2b-256 88ea302f102d6f0a5956ba74633d10b66d4659eca3531e97106d0d8fb0b7ac4a

See more details on using hashes here.

Provenance

The following attestation bundles were made for gwz-0.9.0-cp310-abi3-manylinux_2_39_aarch64.whl:

Publisher: publish.yml on owebeeone/gwz-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gwz-0.9.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: gwz-0.9.0-cp310-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 4.6 MB
  • Tags: CPython 3.10+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gwz-0.9.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d5659f80b063dfb9927b3027f47e4f56240195d36750bdc8a789b7c6cfb5cfae
MD5 0227a6ab7e1b794bb24e062e5788d9bf
BLAKE2b-256 a13fa996faaf6b510927ea803540fcf0040de33e01c05ac2a3332f012fc06f39

See more details on using hashes here.

Provenance

The following attestation bundles were made for gwz-0.9.0-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: publish.yml on owebeeone/gwz-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gwz-0.9.0-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: gwz-0.9.0-cp310-abi3-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: CPython 3.10+, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gwz-0.9.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a4c9300f9e568690fd69e88db7bffa01c1758faf147b2aeff971d2324499fc5d
MD5 9cc7f55695d34855715ba21ae8c6503c
BLAKE2b-256 4db2da6c8c16e6642085b53255f93fbb92b913fda85af8b7de572874c94c6c77

See more details on using hashes here.

Provenance

The following attestation bundles were made for gwz-0.9.0-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: publish.yml on owebeeone/gwz-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.10.5

6 files

0.10.3

6 files

0.10.2

6 files

0.9.2

6 files

0.9.1

6 files

This release

0.9.0 This release

6 files

0.8.2

6 files

0.8.1

6 files

0.7.5

6 files

0.7.4

6 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page