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.10

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.10
File Size Uploaded Provenance Actions
pybuildtools-0.7.10.tar.gz 78.0 kB Without provenance Details for pybuildtools-0.7.10.tar.gz

Built distribution (wheel)

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

Total release size: 216.1 kB

Release files / pybuildtools-0.7.10.tar.gz

Download URL pybuildtools-0.7.10.tar.gz
Size 78.0 kB
Tags Source
SHA-256 checksum
How to use checksums
315deaafc99496e00bdc557fd41765f792c416896ee6f9d8c05d57469dd26249
BLAKE2b-256 checksum
How to use checksums
f56a784691b75baea428a7a046e3cda8cc0ef80c124cdeb657e6b0e70bb93499
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.10-py3-none-any.whl

Download URL pybuildtools-0.7.10-py3-none-any.whl
Size 138.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
690b65772df63191b3177d47eb53421ec627dee31344b32621c492f5a142eae5
BLAKE2b-256 checksum
How to use checksums
c0e3361e55b1e8d8fda75e1ef4486afe6f50fdc9a38cd60fa9ed283df2ac4367
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.10

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.10 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