Giter VIP home page Giter VIP logo

makeyfile

A minimal runner that allows you to specify shell commands, python code, or a sequence containing commands/code.

Inspired by the fact that people end up using Make to specify build/test/run scripts for projects, despites its limited capabilities.

Build Status Test Coverage

Install

$ pip install makeyfile

For development install

$ pip install -e [email protected]:translate/makeyfile#egg=makeyfile
$ pip install makeyfile[test]

Configuration

makeyfile looks for a .Makeyfile.json in the current directory.

In this configuration file you can specify python callable code, shell commands, or sequences that may contain any other python/shell/sequences.

Example configuration:

{
"sequence": {
    "command-sequence0": [
    "shell-command0",
    "shell-command1"
        ],
    "command-sequence1": [
    "command-sequence0",
    "python-command1",
    "shell-command0"
        ],
},
"python": {
    "python-command0": "some.module0.callable_code",
    "python-command1": "some.module1.callable_code"
},
"shell": {
    "shell-command0": "./runsomething",
    "shell-command1": "run-something-else --with flags"
}
}

You can also specify shell and python paths. These are appended to $PYTHONPATH and $PATH before any scripts or code are run.

For example if you have some python code in a folder called scripts (scripts/module0.py in the following example) and some executables in a folder ./some/custom/bin, the following config will allow you to call them.

{
"scripts": ["./scripts"],
"paths": ["./some/custom/.bin"],
"python": {
    "python-command0": "module0.callable_code"
},
"shell": {
    "shell-command0": "run-something"
}
}

Usage

Once configured you can call any of your sequences/code/commands using the makey command.

$ makey command-sequence0
$ makey python-command0
$ makey shell-command0

Passing args

For python commands, all args specified when calling makey are passed through to the python callable as argv.

$ makey python-command0 foo bar # python code receives ["foo", "bar"]

For shell commands, calling args are appended to the specified command.

$ makey shell-command0 foo bar # shell command is called with ``foo bar`` appended

For sequences, you cannot specify any additional command line args at runtime.

phlax's Projects

phlax doesnโ€™t have any public repositories yet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.