puild
A lightweight, modern build tool and command runner for Python.
Features
- Command Runner: Run system commands with fluent argument construction, rich logging, and typed results.
- Pipelines & Redirection: Shell-like piping (
cmd1 | cmd2) and redirection (cmd > "file.txt"). - Streaming & Live Output: Real-time stdout/stderr streaming while capturing output into typed
Resultobjects. - Dry-run & Quiet Modes: Preview commands before execution or silence logs during scripts and testing.
- Build Primitives: Timestamp-based rebuild detection (
needs_rebuild) and filesystem helpers (mkdir,rm,copy,find_files).
Quickstart
1. Basic Command Execution
from puild import Command
# Direct instantiation
cmd = Command("gcc", "-Wall", "-O2", "main.c", "-o", "bin/app")
res = cmd.run(text=True)
if not res.ok:
res.exit_for_error()
2. Fluent Argument Builder & Environment
from puild import Command
cmd = (
Command("gcc")
.arg("-Wall")
.arg("-O2")
.args(["main.c", "-o", "bin/app"])
.env("CFLAGS", "-march=native")
.cwd("src")
)
res = cmd.run(text=True)
print(res.stdout)
3. Piping and File Redirection
from puild import Command
# Pipe between commands
pipe = Command("cat", "access.log") | Command("grep", "ERROR")
res = pipe.run(text=True)
# File redirection
cmd = Command("echo", "build completed") > "build.log"
cmd.run()
# Append to file
cmd = Command("echo", "second step completed") >> "build.log"
cmd.run()
4. Live Streaming Output
Stream output to stdout/stderr in real-time while still capturing the result:
from puild import Command
cmd = Command("pytest", "-v")
res = cmd.run(stream=True, text=True)
5. Incremental Builds (needs_rebuild)
Skip compiling when targets are already up-to-date:
from puild import Command, needs_rebuild, find_files
sources = find_files("src", "*.c")
target = "build/app"
if needs_rebuild(target, sources, log=True):
Command("gcc", *sources, "-o", target).run(check=True)
6. Filesystem Helpers
from puild import mkdir, rm, copy, find_files
# Create directories
mkdir("build/bin")
# Find files
c_files = find_files("src", "*.c", recursive=True)
# Copy files or directories
copy("src/config.json", "build/config.json")
# Remove files or directories
rm("build", recursive=True)
Release files for puild 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| puild-0.1.0.tar.gz | 6.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| puild-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.9 kB
Release files / puild-0.1.0.tar.gz
| Download URL | puild-0.1.0.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b4c1ce83c431966ba94370a2fe57db82bde7aea4f71c45da1d34d7b821fe4cb0
|
|
BLAKE2b-256 checksum How to use checksums |
08dcb81a11ab3c25b0c2ae2395d8fc36bf9d8741313ef452db5dc217a98344ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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":null}
|
Release files / puild-0.1.0-py3-none-any.whl
| Download URL | puild-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f7b8a49afb7c53f02ee72d27807406b4ef9839a7c1914047554e0491232513af
|
|
BLAKE2b-256 checksum How to use checksums |
be47f2f276a2dca2ba681ad8cab88eb1f41cb0d14399eadb47b507e0ce9fa55b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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":null}
|