Skip to main content

Fast task runner for Python projects

Project description

⚡ Zetten

The High-Performance Task Runner for Python Backends. Parallel. Deterministic. Fast.

PyPI - Version PyPI - License PyPI - Python Version CI Status

Zetten is a dependency-aware execution engine designed to unify how you run tests, linters, and builds. It ensures that your workflow remains identical across local development environments and any CI platform, only faster.


🚀 The Zetten Philosophy

Modern Python projects often require coordinating various tools (tests, type-checkers, formatters). Zetten eliminates "Glue Code Fatigue" by providing:

  • Parallel Execution: Automatically identifies independent tasks and runs them concurrently across your CPU cores.
  • Three-Tier Variable: System: Advanced command templating with a strict priority hierarchy: CLI Flags (-k) > Config Vars > Environment Variables.
  • Smart Caching: Uses content-addressable hashing to skip tasks if their specific inputs haven't changed since the last run.
  • Platform Agnostic: Behaves identically on macOS, Windows, Linux, or any CI/CD provider.
  • Dependency Awareness: Define a Directed Acyclic Graph (DAG) of tasks to ensure correct execution order (e.g., setup always precedes test).

✨ Features

  • ⚡ Worker Pool Concurrency: Maximizes resource usage by running non-dependent tasks in parallel.
  • 🏷️ CI Tagging: Execute logical groups of tasks (e.g., run --tag ci) with a single command.
  • 🛡️ Failure Propagation: If a foundational task fails, Zetten halts downstream execution to prevent cascading errors.
  • 🔍 Intelligent Diagnostics: Includes zetten doctor to identify environment inconsistencies instantly.
  • ⏱️ Performance Analytics: (Coming Soon) Real-time insights into time saved via parallelism.

🛠️ Quick Start

Install Zetten:

pip install zetten

Initiate a project:

zetten init

Define tasks in pyproject.toml:

[tool.zetten.tasks.lint]
cmd = "ruff check src"
inputs = ["src/"]
tags = ["ci"]

[tool.zetten.tasks.test]
cmd = "pytest"
depends_on = ["lint"]
inputs = ["src/", "tests/"]
tags = ["ci"]

[tool.zetten.tasks.build]
description = "Build the project"
# Supports Fallback Syntax: ${VAR:-default}
cmd = "mkdir -p ${build_dir} && python -m build --outdir ${DEST:-dist}"
depends_on = ["lint"]
inputs = ["src/"]

Define tasks in zetten.toml:

[tasks.setup]
cmd = "pip install -r requirements.txt"

[tasks.lint]
cmd = "ruff check src"
inputs = ["src/"]
tags = ["ci"]

[tasks.test]
cmd = "pytest"
depends_on = ["setup"]
inputs = ["src/", "tests/"]
tags = ["ci"]

Run tasks:

zetten run test
zetten run lint test

Zetten will only re-run tasks when their inputs change.


⚙️ The Variable Hierarchy

Zetten uses a deterministic three-tier system to resolve variables:

  • Tier 1 (CLI): zetten run build -k build_dir=output (Highest Priority)
  • Tier 2 (Config): Values defined in [tool.zetten.vars]
  • Tier 3 (Env): System environment variables (e.g., $USER, $PATH)

🚀 Running in CI

Zetten is designed for the modern CI/CD pipeline. By using Tags and Strict Mode, you can ensure your pipeline is both flexible and safe.

# Force a specific version and environment in CI
zetten run --tag ci -k VERSION=${GITHUB_SHA} -k ENV=prod

If a foundational task fails, Zetten halts downstream execution immediately to save CI minutes and prevent cascading failures.

⚙️ Configuration Model

Configuration is explicit by design:

  • No templating
  • No conditionals
  • No implicit behavior

Configuration lives in:

  • pyproject.toml (preferred)
  • zetten.toml (for legacy or minimal projects)

If no configuration is found, Zetten will explain how to resolve the issue.


🛠 Commands

  • zetten run — Execute tasks with parallel dependency resolution.
  • zetten run -k KEY=VAL — Override any variable via the CLI.
  • zetten watch — Precision re-runs on input changes.
  • zetten graph — Visualizes the Directed Acyclic Graph (DAG) of your tasks.
  • zetten doctor — Diagnoses configuration and environmental health issues.
  • zetten init — Interactive project setup and template generation.

🛡 Status

Zetten is currently in v0.1. If no configuration file is found, Zetten will provide clear instructions on how to initialize your project.


Documentation

Full documentation is available at: Github Wiki


🤝 Contributing

We love Rust and Python! If you want to help make Zetten even faster:

  • Fork the repo.
  • Add your feature (don't forget the tests!).
  • Open a Pull Request.

Built with ❤️ for the Python community using the speed of Rust.

Please open an issue or discussion on GitHub before proposing large changes.

Project details


Download files

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

Source Distribution

zetten-1.0.8.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

zetten-1.0.8-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file zetten-1.0.8.tar.gz.

File metadata

  • Download URL: zetten-1.0.8.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for zetten-1.0.8.tar.gz
Algorithm Hash digest
SHA256 9cd144e80da7079d5fcc3e52ff5574f2647f5fb62560cc363ac52631fe6c9b81
MD5 bf9f3b156021c9430989b8eea3d01e5d
BLAKE2b-256 bb2b1c5904bc79b39c4716391147770cb373badd07c671aa38c23ed0c9abe237

See more details on using hashes here.

File details

Details for the file zetten-1.0.8-py3-none-any.whl.

File metadata

  • Download URL: zetten-1.0.8-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for zetten-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 64e20d3d5ac3ce37401bd90f04304c242f9573c62f410cb3a3047cc7ed49c605
MD5 52e5efb373044fb08b29bb4a443f1035
BLAKE2b-256 4972334db48577faafbe686585a880a3f304184cb11555e52a22a0c09322c4f9

See more details on using hashes here.

Supported by

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