Skip to main content

Control all Build Systems

Project description

Build System Parser:

This library wraps common build systems and let you control them via python. Supported build systems are

  • bazel
  • make
  • CMake
  • ninja
  • cargo
  • compile_commands.json

Installation:

pip install build_system_parser

A shell.nix is provided for local development.

Usage:

You can either use the function find_build_system(path) to detect the build system automatically like:

# import this package
from build_system_parser import find_build_system

# parse the build system
B = find_build_system("path/to/Makefile")

# afterward the following functions are available
# get all available targets
all_targets = B.targets()
target = B.target("simple")

# build the target via
target.build()
# or
B.build(target)

# now you can run the target
target.run()
B.run(target)

Alternatively you can use a specific build system wrapper directly:

# available builders: Ninja, Make, CMake, Compile_Commands, Cargo
from build_system_parser import Ninja
B = Ninja("path/to/build.ninja")
B.targets()
B.build(B.target("simple"))

Additionally, you can pass specific compiler flags to the builder:

from build_system_parser import Make
B = Make("path/to/Makefile")
t = B.target("name_of_target")
B.build(t, "-O3 -march=native -fno-inline")
B.run(t)

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

build_system_parser-0.0.2.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

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

build_system_parser-0.0.2-py3-none-any.whl (27.5 kB view details)

Uploaded Python 3

File details

Details for the file build_system_parser-0.0.2.tar.gz.

File metadata

  • Download URL: build_system_parser-0.0.2.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for build_system_parser-0.0.2.tar.gz
Algorithm Hash digest
SHA256 4e81018067f8c72a610908fb3c42c772de7dab9164386a2eee98121f9ebd2624
MD5 faa8485ad06b1c1645473cf0f1175e0a
BLAKE2b-256 387b058a233926e893bc1044ee397102c5cdc30a340e4453923ffeb41dd4ea69

See more details on using hashes here.

Provenance

The following attestation bundles were made for build_system_parser-0.0.2.tar.gz:

Publisher: publish.yml on FloydZ/python_builder

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file build_system_parser-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for build_system_parser-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a41166ff4c7ef126144f55f12667f85f4aefa5541d2f23885df8a6ea1c0a7ff3
MD5 ad605f7a696bced6cecd1b45ba034e58
BLAKE2b-256 487a4c19471584e5da5c956a3d05e3c4559372df8022f8befdf195dff1c94190

See more details on using hashes here.

Provenance

The following attestation bundles were made for build_system_parser-0.0.2-py3-none-any.whl:

Publisher: publish.yml on FloydZ/python_builder

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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