Skip to main content

libmake.py

A python library for implementing makefile.py scripts.

Run with pymake!

# makefile.py

import shutil

import libmake
from libmake import rule_vars as r

makefile = libmake.Makefile()


@makefile.add_rule("ciao.html", ["come.md", "va.scss"])
def test_rule():
    # fp = first_prerequisite
    # t = target
    shutil.copy(str(r.fp), str(r.t))
    print("Ciao, come va?")


if __name__ == "__main__":
    libmake.run_make(makefile)

Non-goals

The goal of this package it's not:

  • to provide any pre-built Makefile
  • to deliver an alternative build-system for compiled languages

For the second one there is already make, and other tools specific for more recent languages.

Instead...

Makefile's logic it's useful for projects' tasks automation further than compiling code, e.g.:

  • compiling templates and contents
  • define project's specific commands
    • useful also for collaboration (and to save working patterns anyhow)

Usage

Define a makefile.py using building blocks provided, then run it as a script with targets (so do python makefile.py args... in place of make args...).

See tests/makefile.py for an example makefile definition, and run tests.py to show its output.

Metadata

Release files for libmake 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for libmake 0.3.1
File Interpreter ABI Platform
libmake-0.3.1-py3-none-any.whl Python 3 none any Details

Release files / libmake-0.3.1-py3-none-any.whl

Download URL libmake-0.3.1-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4d4c9e513eabe95ca148994052eb838d915a05e55e702029168d785c25b5869a
BLAKE2b-256 checksum
How to use checksums
e9cd6ab72bde88bbd77bb8d063bdfd2482bcf993e928133fc2630be5f04b49fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

Release history Release notifications | RSS feed

This release

0.3.1 This release

1 release file

0.3.0

1 release file

0.2.4

1 release file

0.2.3

1 release file

0.2.1

2 release files

0.2.0

2 release files

0.1.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page