Skip to main content

Builddrone

Builddrone Project GitHub · PyPI
Environment PyPI version Tests

Builddrone is a JSON-driven build orchestration framework and command-line interface for Python projects. A pipeline is made up of named stages, and each stage executes an ordered list of registered modules.

Installation

Install the latest released version from PyPI:

python -m pip install builddrone

For local development, install the project in editable mode together with its development tools from the repository root:

python -m pip install -e ".[dev]"

Builddrone requires Python 3.10 or newer.

Blueprint format

Builddrone loads blueprint.json from the current working directory. The top-level keys are stage names, and each stage contains module steps:

{
  "build": [
    {
      "module": "python.venv",
      "args": {"source": ".venv"}
    },
    {
      "module": "python.install",
      "args": {"requirements": "requirements.txt"}
    },
    {
      "module": "python.run",
      "args": {"source": "main.py"}
    }
  ]
}

Relative paths are resolved from the directory containing blueprint.json. Each step runs only after the preceding step succeeds.

Command-line usage

Run a stage from the directory containing its blueprint:

cd example/python
python -m builddrone build
python -m builddrone cleanup

The Python example creates .venv automatically, installs its requirements, lints and runs main.py, and builds a wheel and source distribution with python -m build. The separate cleanup stage removes the temporary environment and generated build artifacts.

The Robot Framework example runs similarly:

cd example/robotframework
python -m builddrone test
python -m builddrone cleanup

Its robotframework.test step writes results/output.xml, and robotframework.rebot converts that result into reports under results/rebot.

Built-in modules

Filesystem

Module Arguments Purpose
filesystem.copy source, destination, optional files Copy a directory tree, optionally filtering files with a glob such as *.jpg.
filesystem.cleanup files, folders Remove listed files and folders.

Python

Module Arguments Purpose
python.venv source Select an environment, creating it with pip if needed. An empty source resets the runner.
python.install requirements or source Install requirements or a package with pip.
python.run source Run a Python source file.
python.build none Run python -m build.
python.pylint paths, files, ignore Run Pylint against paths or individual files.

Robot Framework

Both Robot Framework modules accept an ordered arguments list and an optional cwd:

Module Purpose
robotframework.test Run python -m robot.
robotframework.rebot Run python -m robot.rebot to post-process results.

Each string in the list is emitted as a standalone command-line argument. Each single-entry object is emitted as a key followed by its value; list values emit the key followed by multiple values, and boolean true emits only the key. This keeps positional arguments explicit and avoids using null as a sentinel:

{
  "module": "robotframework.test",
  "args": {
    "arguments": [
      {"--outputdir": "results"},
      "tests"
    ]
  }
}

Using Builddrone as a framework

Built-in modules are registered by ExecutionEngine. Custom modules can be added by passing them to the constructor:

from builddrone.base_module import BaseModule
from builddrone.execution_engine import ExecutionEngine


class GreetingModule(BaseModule):
    def run(self, runner, args):
        runner.logger.info("Hello from %s", args.get("name", "Builddrone"))


engine = ExecutionEngine({"custom.greeting": GreetingModule()})
engine.run("build")

The custom module can then be used in blueprint.json:

{
  "build": [
    {
      "module": "custom.greeting",
      "args": {"name": "Builddrone"}
    }
  ]
}

Every module receives a Runner and a dictionary of arguments. The runner executes commands with the currently selected Python interpreter and exposes the blueprint's base directory for relative paths.

Execution flow

python -m builddrone <stage>
        |
        v
load blueprint.json -> select stage -> execute steps -> report failures

Any non-zero command exit code raises DroneException and stops the stage.

License

MIT License

Download files

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

Source Distribution

builddrone-0.2.1.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

builddrone-0.2.1-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file builddrone-0.2.1.tar.gz.

File metadata

  • Download URL: builddrone-0.2.1.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for builddrone-0.2.1.tar.gz
Algorithm Hash digest
SHA256 3b59497e6fc2e1228f329a1767a67e33b85006283787b1b422a4d35684e0ae2b
MD5 1f8adbb5df5fa312ee00df88cd2005b6
BLAKE2b-256 9d9f64f713edebcec4d43f4e758d2114fd5735e8548b02dce49f1c854c97a82c

See more details on using hashes here.

File details

Details for the file builddrone-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: builddrone-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for builddrone-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2b5e204f6755445bbf8f500dd2bb8bbbed463841b8bca99c5fcb3e775fd2c486
MD5 349047f81afcee2934dc60d4db6bc165
BLAKE2b-256 61738a81c31dd041b2f9d6382bc0a9278ce20c0f825410d9c2f03205cec42798

See more details on using hashes here.

Release history Release notifications | RSS feed

0.5.4

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.2

2 files

This release

0.2.1 This release

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

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