Skip to main content

python-build-tools

A toolkit containing many powerful utilities, including:

  • OS utilities (buildtools.os_utils)
  • Indented logging with colorama support (buildtools.bt_logging.log)
  • The powerful Maestro build management system (buildtools.maestro)
  • A powerful VCS repository wrapper system (buildtools.repo)
  • A mess of other random things.

This is mostly a personal toolkit that grew out of control.

os_utils

from buildtools import os_utils

# Ensure test/ exists
os_utils.ensureDirExists('test')

# Get copy of current environmental variables.
ENV = os_utils.ENV.clone()

# Add .bin/ to the beginning of PATH in our virtual environment
ENV.prependTo('PATH', '.bin/')

# Remove any duplicate entries from PATH
ENV.removeDuplicatedEntries('PATH')

# Find gcc in our virtual environment (checks PATHEXT on Windows, too!)
# Returns the path to gcc, or None if it couldn't be found.
GCC = ENV.which('gcc')

# Ensure bash exists before continuing (same rules as above)
ENV.assertWhich('bash')

# Bring up gcc's help page. Crash if non-0 exit code, echo command to console, and output STDOUT/STDERR to console.
os_utils.cmd([GCC, '--help'], critical=True, echo=True, show_output=True)

Logging

from buildtools import log

def a():
  log.info('This will be indented if a() is called in a log block.')

log.info('No indentation, yet.')
with log.warning('A warning. Next line will be indented.'):
  log.error('Error!')
  with log.info('The following function\'s log output will be indented by another layer.')
    a()
    log.critical('So will %s!', 'this')

Maestro

Maestro is currently synchronous, with plans to make it async.

from buildtools.maestro import BuildMaestro
from buildtools.maestro.fileio import ReplaceTextTarget
from buildtools.maestro.coffeescript import CoffeeBuildTarget
from buildtools.maestro.web import SCSSBuildTarget, SCSSConvertTarget

bm = BuildMaestro()

# Compile CoffeeScript to JS
bm.add(CoffeeBuildTarget('htdocs/js/vgws.js',                 ['coffee/src/vgws.coffee']))
bm.add(CoffeeBuildTarget('htdocs/js/editpoll.multichoice.js', ['coffee/editpoll.multichoice.coffee'], dependencies=['htdocs/js/vgws.js']))
bm.add(CoffeeBuildTarget('htdocs/js/editpoll.option.js',      ['coffee/editpoll.editpoll.coffee'], dependencies=['htdocs/js/vgws.js']))

# Convert CSS to SCSS
bm.add(SCSSBuildTarget('htdocs/css/style.css', ['style/style.scss'], [], import_paths=['style'], compass=True))

# Compile, taking dependencies into count when ordering operations.
bm.run()

# Same as above, but providing command line arguments such as --clean, and --rebuild.
bm.as_app()

Metadata

Release files for pybuildtools 0.7.11

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

Source distribution (sdist)

Source distribution for pybuildtools 0.7.11
File Size Uploaded Provenance Actions
pybuildtools-0.7.11.tar.gz 78.0 kB Without provenance Details for pybuildtools-0.7.11.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pybuildtools 0.7.11
File Interpreter ABI Platform Actions
pybuildtools-0.7.11-py3-none-any.whl Python 3 none any Details for pybuildtools-0.7.11-py3-none-any.whl

Total release size: 216.1 kB

Release files / pybuildtools-0.7.11.tar.gz

Download URL pybuildtools-0.7.11.tar.gz
Size 78.0 kB
Tags Source
SHA-256 checksum
How to use checksums
45031dc19713a0d8f0823cb18b020decb96713b908c6ea3c52f1eb916497de5d
BLAKE2b-256 checksum
How to use checksums
5ec958577e94860bbbd6d278d433115435d87c3606cf435ec56ecb4f7e330ebc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / pybuildtools-0.7.11-py3-none-any.whl

Download URL pybuildtools-0.7.11-py3-none-any.whl
Size 138.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d852e6f54e2f039c920976e1f73ffc90a4944f3b01d57206a9d4a92392d14b1
BLAKE2b-256 checksum
How to use checksums
cdb6e4f1813f1b0eb1a2c03e5f081dcc4477a2d67721c64ea706cc8b929a697f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for pybuildtools 0.7.11

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.

Release history Release notifications | RSS feed

This release

0.7.11 This release

2 release files No provenance

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