Skip to main content

A python-based traceable make system

Project description

Phantom Make (PTM)

A Python-based traceable make system that provides enhanced build automation capabilities with improved traceability and programmability. It's designed to help developers maintain complex multi-configuration build processes while ensuring reliable and reproducible builds.

Features

  • Python-based syntax
  • Enhanced build traceability
  • Programmable parameter system

Installation

pip install phantom-make

And you can also install PTM directly from the GitHub repository:

git clone https://github.com/Phantom1003/ptm.git
cd ptm
pip install -e .

Requirements

  • Python 3.10 or higher

Usage

Syntax Sugar Features

PTM provides powerful syntax sugar to make build scripts more concise and readable:

  1. Shell Command Execution

    # Traditional Python
    exec("gcc -o main main.c")
    
    # PTM Syntax Sugar
    $"gcc -o main main.c"
    
    # Capture stdout
    output = $>"ls -l"
    
    # Capture stderr
    error = $>>"gcc -v"
    
    # Capture both stdout and stderr
    result = $&"make"
    
  2. Environment Variables

    # Traditional Python
    os.environ["PATH"]
    
    # PTM Syntax Sugar
    ${PATH}
    
    # In f-strings
    path = f"Current path: {${PATH}}"
    
  3. String Division for Paths

    # Traditional Python
    os.path.join("src", "main", "file.c")
    
    # PTM Syntax Sugar
    "src" / "main" / "file.c"
    

Basic Usage

PTM provides a Python-based interface for defining build rules and dependencies. Here's a basic example:

  1. File Targets

    from ptm import target
    
    @target("output.txt", ["input.txt"])
    def build_output(target, deps):
        with open(deps[0], 'r') as f:
            data = f.read()
        with open(target, 'w') as f:
            f.write(data.upper())
    
  2. Multiple Targets

    from ptm import targets
    
    @targets(["output1.txt", "output2.txt"], ["input.txt"])
    def build_outputs(target, deps):
        with open(deps[0], 'r') as f:
            data = f.read()
        with open(target, 'w') as f:
            f.write(data.upper())
    
  3. Task Targets

    from ptm import task
    
    @task()
    def setup_environment(target, deps):
        print("Setting up environment...")
    
    @task([setup_environment])
    def build_project(target, deps):
        print("Building project...")
    
  4. Mixed Dependencies

    from ptm import target, task
    
    @task()
    def prepare_data(target, deps):
        print("Preparing data...")
    
    @target("output.txt", [prepare_data, "input.txt"])
    def build_output(target, deps):
        print("Building output...")
    

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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

phantom_make-0.1.18.tar.gz (24.9 kB view details)

Uploaded Source

Built Distribution

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

phantom_make-0.1.18-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

Details for the file phantom_make-0.1.18.tar.gz.

File metadata

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

File hashes

Hashes for phantom_make-0.1.18.tar.gz
Algorithm Hash digest
SHA256 8c95763e64147c9d75a29fec3bc9a3f1f8b12904ad5d01791ef37093fdb1741b
MD5 c5b1f876f87f85adddc7021ecedacb62
BLAKE2b-256 1ce8ec1b9a7646b4dff98172678fa5b2e1a210fdc686c7fe54856b067b4f54e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for phantom_make-0.1.18.tar.gz:

Publisher: python-publish.yml on Phantom1003/ptm

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

File details

Details for the file phantom_make-0.1.18-py3-none-any.whl.

File metadata

  • Download URL: phantom_make-0.1.18-py3-none-any.whl
  • Upload date:
  • Size: 23.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for phantom_make-0.1.18-py3-none-any.whl
Algorithm Hash digest
SHA256 e4762dd822b1f3d4e5c378d277169aa3b234b2bc4d5f4fb60935c605f3119ecb
MD5 983ae0e211faff7ede76055ffe824da8
BLAKE2b-256 b344c71a5ec226103a946262161710afdda5e517dacc6cbd60e9d102ba9b9317

See more details on using hashes here.

Provenance

The following attestation bundles were made for phantom_make-0.1.18-py3-none-any.whl:

Publisher: python-publish.yml on Phantom1003/ptm

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