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.3.tar.gz (19.0 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.3-py3-none-any.whl (28.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: build_system_parser-0.0.3.tar.gz
  • Upload date:
  • Size: 19.0 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.3.tar.gz
Algorithm Hash digest
SHA256 3dba4d324b7f1086831d74cc7435f1dad7810d00fd50b8b92dea18d17888f269
MD5 ed2b802c4bd0ce34afa403bafeb98a35
BLAKE2b-256 594fe62437dafa347f2821370183fcb4ec94675e9e9a0f74172d6dbd790b3ae5

See more details on using hashes here.

Provenance

The following attestation bundles were made for build_system_parser-0.0.3.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.3-py3-none-any.whl.

File metadata

File hashes

Hashes for build_system_parser-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bd01c05384bf6670ee56e3a754b418c6c5981a1da4ec9e6bb72a6523adb90ff6
MD5 d947f723168f533dfda81dc0fe63a301
BLAKE2b-256 c5edcd29f0d105d72186ca0518c483bbf46b89c5c9206e8f7e13da9d8e8675b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for build_system_parser-0.0.3-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