Pun
Pun mini task to build, deploy or anything you like in your project
- Free software: MIT license
- Documentation: https://pun.readthedocs.io.
In development
Features
- Run task (of course).
- Run multiple tasks at once
- Run a required task when a task need to run other task
- load a fixture (like in pytest)
Usage
You need a punfile.py to run a task.
To create a sample punfile.py run:
$ pun init
After [ success ] init
, you get you sample punfile.py in your current
directory:
import pun
DEFAULT = 'default'
@pun.task()
def default():
"""
Run default action.
"""
text = "This is a sample punfile (you can edit)"
pun.run('echo', text)
A task is a function decorated with @pun.task()
.
To run this default task, type:
$ pun default
$ # or just
$ pun
We can omit task name (default) because we set DEFAULT = 'default'
.
DEFAULT
is a variable to handle a default task name to run if we don't
provide a task name in console.
As you can see pun.run()
function run passed arguments in a shell, the
first argument can be a callable and all arguments after it are passed to that
callable.
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.