Skip to main content

Small build system

Project description

Mapyr v.0.8.9

Mapyr is a small build system written in Python 3. It uses Python for build files (no new languages required) and inherits the Makefile rule system, extending and complementing it.

Advantages of Mapyr:

  • Small size
  • Project system
  • Simple hierarchy
  • Modular addon system for easily adding support for new languages (language modules are provided for convenience, but not required)

Quick start

C/C++ example:

build.py:

#!/usr/bin/env python

from mapyr import *

def get_project(name:str) -> ProjectBase:
    cfg = c.Config()

    # Dirs to find source files
    cfg.SRC_DIRS = ['src']

    # Create project ( name, output filename, config )
    project = c.Project('main','bin/main',cfg)

    # Default rules for C project like: build, clean, and executable
    c.add_default_rules(project)

    return project

if __name__ == "__main__":
    process(get_project)

Run ./build.py

Install

pip install mapyr

Usage

Mapyr starts with a build.py file, call process funcution and which calls get_project.

Rule System

Mapyr's rule system is derived from GNU Make:

  • Target: A file (or phony target) that must exist or be built.
  • Prerequisites: A list of rules that must be built before this rule.
  • Execution: The commands to build the target.

If any prerequisite is newer than the target, the rule is rebuilt.

Projects

Projects are used to share configurations. A project groups multiple rules into a single unit, managing private, protected, and public configurations. This is similar to access modifiers in C++, but less strict. You choose which configurations to inherit from subprojects. The separation helps clarify a project's public interface versus its internal implementation.

  • Private: Accessible only within the project.
  • Protected: Accessible within the project and its children.
  • Public: Accessible to any project that includes this one as a subproject.

Examples

See the examples in the test directory.

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

mapyr-0.8.9.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

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

mapyr-0.8.9-py2.py3-none-any.whl (11.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file mapyr-0.8.9.tar.gz.

File metadata

  • Download URL: mapyr-0.8.9.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.10.12 Linux/5.15.0-133-generic

File hashes

Hashes for mapyr-0.8.9.tar.gz
Algorithm Hash digest
SHA256 6734256dfaa00a1daec862b8a2654decd34db29d82021fcd87d8d1a67862a753
MD5 af66fb8027b76653c26a0eb70abfc029
BLAKE2b-256 05fde649ddd305edc710ff1ac1b5460a2e481b4562746e3073419a0fbe024757

See more details on using hashes here.

File details

Details for the file mapyr-0.8.9-py2.py3-none-any.whl.

File metadata

  • Download URL: mapyr-0.8.9-py2.py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.10.12 Linux/5.15.0-133-generic

File hashes

Hashes for mapyr-0.8.9-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6ca12e2d4c915984eaac9438de5f3b17f72f298abff82408fa8ce8abd5a9d336
MD5 b1176d2cda56cddb59521ef4486b20d4
BLAKE2b-256 9ee874e21b44ca07bf9065e9f92134b21d1b8cccfe69238ae580e89206c57ccf

See more details on using hashes here.

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