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:
-
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"
-
Environment Variables
# Traditional Python os.environ["PATH"] # PTM Syntax Sugar ${PATH} # In f-strings path = f"Current path: {${PATH}}"
-
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:
-
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())
-
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())
-
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...")
-
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file phantom_make-0.1.16.tar.gz.
File metadata
- Download URL: phantom_make-0.1.16.tar.gz
- Upload date:
- Size: 23.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca9e6238635994e7d9af78b0f665893feaf7ea7c2dc4e50a3936093fbb40e2d9
|
|
| MD5 |
ae65aa500242d31f7e8ae1d9f7c86270
|
|
| BLAKE2b-256 |
927f107a075a3b331fc5e64d5dc5c6a26c3fd8b6bc469b22ff17d1c5b16ecc87
|
Provenance
The following attestation bundles were made for phantom_make-0.1.16.tar.gz:
Publisher:
python-publish.yml on Phantom1003/ptm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
phantom_make-0.1.16.tar.gz -
Subject digest:
ca9e6238635994e7d9af78b0f665893feaf7ea7c2dc4e50a3936093fbb40e2d9 - Sigstore transparency entry: 774603631
- Sigstore integration time:
-
Permalink:
Phantom1003/ptm@a19c503908b5d146d9a2d4a09be607b0f9db749a -
Branch / Tag:
refs/tags/v0.1.16 - Owner: https://github.com/Phantom1003
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@a19c503908b5d146d9a2d4a09be607b0f9db749a -
Trigger Event:
push
-
Statement type:
File details
Details for the file phantom_make-0.1.16-py3-none-any.whl.
File metadata
- Download URL: phantom_make-0.1.16-py3-none-any.whl
- Upload date:
- Size: 22.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
578b9f1f4ff3a010c96620264bd13ffd5e02f4ba02a2fd66c91f23abfa28d8af
|
|
| MD5 |
26007138f56bb7d9069e0414a4948c3e
|
|
| BLAKE2b-256 |
7204b1ca9f7f91745853b2d7deed48ac71a9261cd983c2358d8422efe42b14b7
|
Provenance
The following attestation bundles were made for phantom_make-0.1.16-py3-none-any.whl:
Publisher:
python-publish.yml on Phantom1003/ptm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
phantom_make-0.1.16-py3-none-any.whl -
Subject digest:
578b9f1f4ff3a010c96620264bd13ffd5e02f4ba02a2fd66c91f23abfa28d8af - Sigstore transparency entry: 774603632
- Sigstore integration time:
-
Permalink:
Phantom1003/ptm@a19c503908b5d146d9a2d4a09be607b0f9db749a -
Branch / Tag:
refs/tags/v0.1.16 - Owner: https://github.com/Phantom1003
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@a19c503908b5d146d9a2d4a09be607b0f9db749a -
Trigger Event:
push
-
Statement type: