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
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
File details
Details for the file phantom-make-0.1.0.tar.gz.
File metadata
- Download URL: phantom-make-0.1.0.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e98366e9dc601e64480fc64fdd7f56f51c15c9bbad2f35fded48cf34d74f288c
|
|
| MD5 |
fa3344bae546408499d4d5eea394e373
|
|
| BLAKE2b-256 |
30cb163c77efb2f71f75df8bbe520b297c2eb7da45bb05b7f10ae366ac9cb925
|