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.

Metadata

Release files for fabricatio-workspace 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for fabricatio-workspace 0.1.6
File Actions
fabricatio_workspace-0.1.6-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for fabricatio_workspace-0.1.6-cp314-cp314-win_amd64.whl
fabricatio_workspace-0.1.6-cp314-cp314-manylinux_2_34_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.34+ x86-64 Details for fabricatio_workspace-0.1.6-cp314-cp314-manylinux_2_34_x86_64.whl
fabricatio_workspace-0.1.6-cp314-cp314-manylinux_2_34_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.34+ ARM64 Details for fabricatio_workspace-0.1.6-cp314-cp314-manylinux_2_34_aarch64.whl
fabricatio_workspace-0.1.6-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details for fabricatio_workspace-0.1.6-cp314-cp314-macosx_11_0_arm64.whl
fabricatio_workspace-0.1.6-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for fabricatio_workspace-0.1.6-cp313-cp313-win_amd64.whl
fabricatio_workspace-0.1.6-cp313-cp313-manylinux_2_34_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.34+ x86-64 Details for fabricatio_workspace-0.1.6-cp313-cp313-manylinux_2_34_x86_64.whl
fabricatio_workspace-0.1.6-cp313-cp313-manylinux_2_34_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.34+ ARM64 Details for fabricatio_workspace-0.1.6-cp313-cp313-manylinux_2_34_aarch64.whl
fabricatio_workspace-0.1.6-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for fabricatio_workspace-0.1.6-cp313-cp313-macosx_11_0_arm64.whl
fabricatio_workspace-0.1.6-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for fabricatio_workspace-0.1.6-cp312-cp312-win_amd64.whl
fabricatio_workspace-0.1.6-cp312-cp312-manylinux_2_34_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.34+ x86-64 Details for fabricatio_workspace-0.1.6-cp312-cp312-manylinux_2_34_x86_64.whl
fabricatio_workspace-0.1.6-cp312-cp312-manylinux_2_34_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.34+ ARM64 Details for fabricatio_workspace-0.1.6-cp312-cp312-manylinux_2_34_aarch64.whl
fabricatio_workspace-0.1.6-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for fabricatio_workspace-0.1.6-cp312-cp312-macosx_11_0_arm64.whl

Total release size: 21.2 MB

Release files / fabricatio_workspace-0.1.6-cp314-cp314-win_amd64.whl

Download URL fabricatio_workspace-0.1.6-cp314-cp314-win_amd64.whl
Size 1.9 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
3a6c7d824c3c0e16f562c2761d2f70313fc61595da90430c576a0cc35700daaa
BLAKE2b-256 checksum
How to use checksums
a87b54985831bf31fc86c752a22fd2f72aca0fcf928e78245911c61dc063445d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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}

Release files / fabricatio_workspace-0.1.6-cp314-cp314-manylinux_2_34_x86_64.whl

Download URL fabricatio_workspace-0.1.6-cp314-cp314-manylinux_2_34_x86_64.whl
Size 1.8 MB
Tags CPython 3.14 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
cdde4012bb158c86f0bc57d899e2e57d1c7a3a97d15d6d9588b1a4d3718ea30b
BLAKE2b-256 checksum
How to use checksums
82aca7f450cb482bbe15c63be26938d0ffe132085484985b8157ac608e4f7cc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fabricatio_workspace-0.1.6-cp314-cp314-manylinux_2_34_aarch64.whl

Download URL fabricatio_workspace-0.1.6-cp314-cp314-manylinux_2_34_aarch64.whl
Size 1.7 MB
Tags CPython 3.14 Linux glibc 2.34+ ARM64
SHA-256 checksum
How to use checksums
d4f501165a28added6931e9ea846d494ff123c52023b20cab14780cbb50985fa
BLAKE2b-256 checksum
How to use checksums
be95cdb3a2fe4b48fa73c6143b61767df244a907affcf34aa9962e4a4d83d07a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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}

Release files / fabricatio_workspace-0.1.6-cp314-cp314-macosx_11_0_arm64.whl

Download URL fabricatio_workspace-0.1.6-cp314-cp314-macosx_11_0_arm64.whl
Size 1.7 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ab039a9b5103a3811627ce02632e56d79afd07e7d6c2442a3c5021af27611888
BLAKE2b-256 checksum
How to use checksums
87dcc515984431f9e56229529f4adaef0d4c69ddff1a89db59a6fe981e188319
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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}

Release files / fabricatio_workspace-0.1.6-cp313-cp313-win_amd64.whl

Download URL fabricatio_workspace-0.1.6-cp313-cp313-win_amd64.whl
Size 1.9 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
0b98b4abf844338642f942851288913e0d454833b5d7e5d4c3c907d2832724b8
BLAKE2b-256 checksum
How to use checksums
ef129db342eb6d817914a85245a9401ce449a0dabea5359386291e56642e21e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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}

Release files / fabricatio_workspace-0.1.6-cp313-cp313-manylinux_2_34_x86_64.whl

Download URL fabricatio_workspace-0.1.6-cp313-cp313-manylinux_2_34_x86_64.whl
Size 1.8 MB
Tags CPython 3.13 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
a4fefc139903ce4acfc77746514eb381beaa06ea66c239efeaafaa5740630d22
BLAKE2b-256 checksum
How to use checksums
32af3d4c227e61d2dedf3f5e4734bcf0135f35d63221ec3d521fae7c3b46fb35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fabricatio_workspace-0.1.6-cp313-cp313-manylinux_2_34_aarch64.whl

Download URL fabricatio_workspace-0.1.6-cp313-cp313-manylinux_2_34_aarch64.whl
Size 1.7 MB
Tags CPython 3.13 Linux glibc 2.34+ ARM64
SHA-256 checksum
How to use checksums
33299adff23b59b4187872219d23ff8fccf091fcbb7cbbb4b787b6f6f14cf2d2
BLAKE2b-256 checksum
How to use checksums
fbedcb9c7d0951a6240db1b278cd95dcb1a43b39aaaecdbd613be18d458644a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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}

Release files / fabricatio_workspace-0.1.6-cp313-cp313-macosx_11_0_arm64.whl

Download URL fabricatio_workspace-0.1.6-cp313-cp313-macosx_11_0_arm64.whl
Size 1.7 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
327c570631045f80f785da1e5d21dbfd256ca76b13330a7b8ade76f926d0c1cb
BLAKE2b-256 checksum
How to use checksums
c693bf4ebac8754927c03a56008a6816e88fea367cda186a187375104c278c05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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}

Release files / fabricatio_workspace-0.1.6-cp312-cp312-win_amd64.whl

Download URL fabricatio_workspace-0.1.6-cp312-cp312-win_amd64.whl
Size 1.9 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
d32207acc655824805a56cedeb931871441bb448c79c2bdf6be7209f31136fad
BLAKE2b-256 checksum
How to use checksums
0cf05779287c44027f42f28f274785c684dad127c69ff0996483f2192d15ffc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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}

Release files / fabricatio_workspace-0.1.6-cp312-cp312-manylinux_2_34_x86_64.whl

Download URL fabricatio_workspace-0.1.6-cp312-cp312-manylinux_2_34_x86_64.whl
Size 1.8 MB
Tags CPython 3.12 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
6c216afa77484069a447604a30402c61fe1dde6848a7256e336c60e439b4e0d9
BLAKE2b-256 checksum
How to use checksums
f25e109ef8363b6cdf762d15ed46be7188c34fac03e7bee41da91e6c66118278
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fabricatio_workspace-0.1.6-cp312-cp312-manylinux_2_34_aarch64.whl

Download URL fabricatio_workspace-0.1.6-cp312-cp312-manylinux_2_34_aarch64.whl
Size 1.7 MB
Tags CPython 3.12 Linux glibc 2.34+ ARM64
SHA-256 checksum
How to use checksums
0c12149b87c509f87b7fedd7218d14497a75713d798c18f35a53de3537d1a511
BLAKE2b-256 checksum
How to use checksums
eaf9753b05d997e813d00f24b1fea0db692913943444721bb3e3e9a9d3548862
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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}

Release files / fabricatio_workspace-0.1.6-cp312-cp312-macosx_11_0_arm64.whl

Download URL fabricatio_workspace-0.1.6-cp312-cp312-macosx_11_0_arm64.whl
Size 1.7 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7fef169492da8729cabf0317b074b96589fc40c4a37f1e0eccb11ed0b60640aa
BLAKE2b-256 checksum
How to use checksums
9f22347a26b3e0f76a11fee92cbe1236f7a6bcc00ec489025a692f5b6d8175d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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}

Security for fabricatio-workspace 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page