Skip to main content

fabricatio-workspace

MIT Python Versions PyPI Version PyPI Downloads PyPI Downloads Bindings: PyO3 Build Tool: uv + maturin

Git worktree management for Fabricatio, backed by Rust via PyO3 bindings.


Installation

pip install fabricatio[workspace]
# or: pip install fabricatio-workspace

Overview

fabricatio-workspace provides high-performance Git worktree operations — fork, commit, and prune — implemented in Rust and exposed to Python through PyO3 bindings. It is designed for agent-driven workflows that need to create isolated working branches, commit changes programmatically, and clean up stale worktrees.

The Rust layer uses git2 (libgit2) directly, avoiding subprocess overhead and providing structured error handling for every operation.

Key API

All core functions live in fabricatio_workspace.rust. A thin Python wrapper is available via fabricatio_workspace.capabilities.workspace.Workspace.

fork(repo_path, to, branch_name, base_branch=None, exist_ok=False) -> Path

Creates a new Git worktree linked to a branch. Creates the branch if it does not exist (optionally from base_branch). Returns the absolute path to the new worktree.

  • exist_ok=True: returns the existing worktree path instead of raising if the branch is already checked out.
  • On failure, partial directories are automatically cleaned up.

commit(worktree_path, msg, files=None) -> str

Stages and commits changes in a worktree. Returns the hex OID of the new commit.

  • files: optional list of relative paths to stage. If None or empty, all modified tracked files are staged.
  • Author/committer identity is read from the worktree's Git config.

prune(repo_path) -> int

Prunes all stale worktree metadata from the repository. Returns the number of worktrees pruned. After pruning, branches previously locked by stale worktrees become available for checkout.

Workspace (Python wrapper)

from fabricatio_workspace.capabilities.workspace import Workspace

ws = Workspace()
path = ws.fork("/path/to/repo", "/tmp/feature-42", "feature/42", base_branch="main")
oid = ws.commit(path, "Add new feature", files=["src/module.py"])

Configuration

The schema currently defines no options and is reserved for future use. Set them under the [ext.workspace] table in fabricatio.toml, equivalently under [tool.fabricatio.ext.workspace] in pyproject.toml, or via FABRICATIO_EXT__WORKSPACE__<FIELD_UPPER> environment variables.

# fabricatio.toml
[ext.workspace]

Access at runtime: from fabricatio_workspace.config import workspace_config.

Usage Example

from pathlib import Path
from fabricatio_workspace.rust import fork, commit, prune

repo = Path("/home/user/my-project")

# Fork a new worktree from main
wt = fork(repo, Path("/tmp/worktrees/task-1"), "task/do-thing", base_branch="main")

# ... make changes to files in wt ...

# Commit all modified files
commit_oid = commit(wt, "Complete the task", files=None)
print(f"Committed: {commit_oid}")

# Clean up stale worktrees
removed = prune(repo)
print(f"Pruned {removed} stale worktree(s)")

Dependencies

  • fabricatio-core — configuration loading and core interfaces
  • git2 (vendored, via libgit2) — all Git operations run in-process through Rust, no git CLI required

License

This project is licensed under the MIT License.

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

fabricatio_workspace-0.1.5-cp314-cp314-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.14Windows x86-64

fabricatio_workspace-0.1.5-cp314-cp314-manylinux_2_34_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

fabricatio_workspace-0.1.5-cp314-cp314-manylinux_2_34_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ ARM64

fabricatio_workspace-0.1.5-cp314-cp314-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

fabricatio_workspace-0.1.5-cp313-cp313-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.13Windows x86-64

fabricatio_workspace-0.1.5-cp313-cp313-manylinux_2_34_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

fabricatio_workspace-0.1.5-cp313-cp313-manylinux_2_34_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

fabricatio_workspace-0.1.5-cp313-cp313-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

fabricatio_workspace-0.1.5-cp312-cp312-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.12Windows x86-64

fabricatio_workspace-0.1.5-cp312-cp312-manylinux_2_34_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

fabricatio_workspace-0.1.5-cp312-cp312-manylinux_2_34_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64

fabricatio_workspace-0.1.5-cp312-cp312-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file fabricatio_workspace-0.1.5-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: fabricatio_workspace-0.1.5-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_workspace-0.1.5-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 4df97cfc668435bbcea4255ad3b3c8d9afb766d6d66ace3c5ce18c819f9eeceb
MD5 10a0976c32fadbd63c4fde1ad64947e3
BLAKE2b-256 69b140c95f5b898f17facaf7386c03345d84fadb63cfab190ab5e3a571289de6

See more details on using hashes here.

File details

Details for the file fabricatio_workspace-0.1.5-cp314-cp314-manylinux_2_34_x86_64.whl.

File metadata

  • Download URL: fabricatio_workspace-0.1.5-cp314-cp314-manylinux_2_34_x86_64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.14, manylinux: glibc 2.34+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_workspace-0.1.5-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 cafef41566a40002ad1e162b59b5c14326e804d6568932024f563f95fcf1e622
MD5 7277232c136b429040edf2b535baa7f5
BLAKE2b-256 823483b56a215464d1102f55785efc794796fff0549bff71943a110103e50f3e

See more details on using hashes here.

File details

Details for the file fabricatio_workspace-0.1.5-cp314-cp314-manylinux_2_34_aarch64.whl.

File metadata

  • Download URL: fabricatio_workspace-0.1.5-cp314-cp314-manylinux_2_34_aarch64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.14, manylinux: glibc 2.34+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_workspace-0.1.5-cp314-cp314-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 ae9e518dd46ff16ac1b92b1ecf6672119b75c7751bda8928a62b6ba9cebf967c
MD5 6c36a41f4e11f6956a0e7a55b102d3ad
BLAKE2b-256 7ee4103e6142148261e216048f0bb5cf77109af3da5cd624faf24a5f28786adc

See more details on using hashes here.

File details

Details for the file fabricatio_workspace-0.1.5-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

  • Download URL: fabricatio_workspace-0.1.5-cp314-cp314-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.14, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_workspace-0.1.5-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ec0b3c12b990a2498d48133c90b36303b7a5741da2513c50220fc8b000f2c4f7
MD5 3fd19f0ef20b448e5cbe96fd1ed2a72d
BLAKE2b-256 691dfdca9e2856af71f9e28d0724a1e4053cd59d1d2bde1b66e10cd6ecbd7755

See more details on using hashes here.

File details

Details for the file fabricatio_workspace-0.1.5-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: fabricatio_workspace-0.1.5-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_workspace-0.1.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 7cb3503e1a7cc55945726e5141071c3e435c1cf89293f465f9e2ec0854b90fdb
MD5 dda2cf8034338352fd24f9b423b22a3f
BLAKE2b-256 bd263b8022c2cd2153940ee58c5e6c36c1c9cc2e1976a755ae84d72afef1eb6f

See more details on using hashes here.

File details

Details for the file fabricatio_workspace-0.1.5-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

  • Download URL: fabricatio_workspace-0.1.5-cp313-cp313-manylinux_2_34_x86_64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.13, manylinux: glibc 2.34+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_workspace-0.1.5-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 8dd25adca000df4b2b2625f32bac86fa8c4e7a287763d0f4353235d5841d8fa5
MD5 b841bbb3b5d8df76894be00f943558e7
BLAKE2b-256 79e73d77bd0034ef4a4022d193723ee345ffdf1b4f7bebf8af3170c465531e56

See more details on using hashes here.

File details

Details for the file fabricatio_workspace-0.1.5-cp313-cp313-manylinux_2_34_aarch64.whl.

File metadata

  • Download URL: fabricatio_workspace-0.1.5-cp313-cp313-manylinux_2_34_aarch64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.13, manylinux: glibc 2.34+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_workspace-0.1.5-cp313-cp313-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 48a13e9ca407a1b2c83628fde44fcc43bb9dd50825a8db8db67a155a8481c0bd
MD5 a4d7a00a41a1c2cc31683525e53feaf8
BLAKE2b-256 8116e3632ff5ac1fc47e1c081dfae2c8fe8097228ff9bf778668bac6f707692e

See more details on using hashes here.

File details

Details for the file fabricatio_workspace-0.1.5-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

  • Download URL: fabricatio_workspace-0.1.5-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_workspace-0.1.5-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8ec39b3af7e75a646cdde8f5466200a718e3cbd3989519d133dd7bf177e91d33
MD5 12990df87e30e1fef47351924b458388
BLAKE2b-256 f0e4ea778ad6d88c6bf0c39b84f5bc4af21d1d85ed346ed1f7d9a5a416847740

See more details on using hashes here.

File details

Details for the file fabricatio_workspace-0.1.5-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: fabricatio_workspace-0.1.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_workspace-0.1.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ae416206f76432fa5117f105d90c6fb4352957d9dc20fe7f235ab70205ca5f6f
MD5 016d3d954225dc0182c2259d3b5f1d86
BLAKE2b-256 a913484ce9c6718ae0f405fcefe32e5143cc4c53cc1839c2b8431c7aa111dcc0

See more details on using hashes here.

File details

Details for the file fabricatio_workspace-0.1.5-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

  • Download URL: fabricatio_workspace-0.1.5-cp312-cp312-manylinux_2_34_x86_64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.12, manylinux: glibc 2.34+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_workspace-0.1.5-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 daab4eb10a182c1f5d5531292c83d75d74e00895aa57b78773a1733aadf74db9
MD5 6f6058539980188e4f78199ef8304a41
BLAKE2b-256 5fc2b56aac543a18b97785840b99540741f00a597353ff90c7c4d11c22a6101c

See more details on using hashes here.

File details

Details for the file fabricatio_workspace-0.1.5-cp312-cp312-manylinux_2_34_aarch64.whl.

File metadata

  • Download URL: fabricatio_workspace-0.1.5-cp312-cp312-manylinux_2_34_aarch64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.12, manylinux: glibc 2.34+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_workspace-0.1.5-cp312-cp312-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 139a9127c236ae142270f8ca107c64ac1329866ecb23380f546e29ae915717c9
MD5 b17cc81f89779c00862bec58f01c47ea
BLAKE2b-256 9473df0581ee13e82ed5487e5df9fe035189020ad1cc6f84bc0bb5fd27899e3a

See more details on using hashes here.

File details

Details for the file fabricatio_workspace-0.1.5-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

  • Download URL: fabricatio_workspace-0.1.5-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_workspace-0.1.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 661a16518501a6e18a7571628a62e9db9e98894a88f6512c2416b543d033ae82
MD5 4cfa3c0c787ae046e6e4bf53f1ce1966
BLAKE2b-256 d27c035a5288cb51e1882788e7b58326fecb788654d9a65001d87a197ba48dab

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.5 This release

12 files

0.1.4

12 files

0.1.2

12 files

0.1.0

12 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