Skip to main content

PyProd: More Makeable than Make

Project description

PyProd is a Python script that can be used as an alternative to Makefile. By leveraging Python’s versatility, it enables you to define build rules and dependencies programmatically, allowing for dynamic configurations, integration with existing Python libraries, and custom build logic not easily achievable with traditional Makefiles. For detailed documentation, please refer to the official documentation.

Features

  • Define build rules in Python: Use Python functions to create clear and concise build logic.

  • Specify dependencies for each rule: Automatically track and resolve dependencies between files, such as source files and headers.

  • Easily extendable with custom Python functions: Integrate custom logic for specialized tasks, like code linting or deployment.

  • Manages virtual environments: Automatically create and manage virtual environments for each project, ensuring a clean and isolated build environment.

Installation

To install PyProd, simply use pip:

pip install pyprod

Usage

With PyProd, a traditional Makefile for C can be expressed as a Python script like this:

CC = "gcc"
CFLAGS = "-c -I."
DEPS = "hello.h"
OBJS = "hello.o main.o".split()
EXE = "hello.exe"

@rule("%.o", depends=("%.c", DEPS))
def compile(target, src, *deps):
    run(CC, "-o", target, src, CFLAGS)

@rule(EXE, depends=OBJS)
def link(target, *objs):
    run(CC, "-o", target, objs)

@task
def clean():
    run("rm -f", OBJS, "hello.exe")

@task
def rebuild():
    build(clean, EXE)

To run the build script, simply execute:

$ cd project
$ pyprod

Other examples can be found in the samples directory.

License

PyProd is licensed under the MIT License. See the LICENSE file for more details.

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

pyprod-0.9.0.tar.gz (384.5 kB view details)

Uploaded Source

Built Distribution

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

pyprod-0.9.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file pyprod-0.9.0.tar.gz.

File metadata

  • Download URL: pyprod-0.9.0.tar.gz
  • Upload date:
  • Size: 384.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyprod-0.9.0.tar.gz
Algorithm Hash digest
SHA256 41c00beb2e6fb7c2f7f7ad2fbe78f031b173eb31bf5b423417d5bf1cbaf5475b
MD5 dda0093c528304f6029bf4d2f4622e3e
BLAKE2b-256 3b1b73e914d0872b20a67b5f8d4bae24f35e6368974fe108cf198fa6c2d38ba8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyprod-0.9.0.tar.gz:

Publisher: publish.yml on atsuoishimoto/pyprod

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

File details

Details for the file pyprod-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: pyprod-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyprod-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7f8760c0b2035e6f1bba626d30b61dfd418d6f2069a5586c52108be82dc8889
MD5 f2a14bd6f1715dd81620ac0280a23e19
BLAKE2b-256 531ed58a48a4311adb17902f314ea42c8256e9ee1e580f1854a18ace32bcafdf

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyprod-0.9.0-py3-none-any.whl:

Publisher: publish.yml on atsuoishimoto/pyprod

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