You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pynt-contrib has a collection of tasks and utilities for pynt. pynt-contrib allows pynt itself to continue to be simple, while enhancing it.
Installation
You can install pynt-contrib from the Python Package Index (PyPI) using pip (pip install pynt-contrib) or easy_install (easy_install pynt-contrib), or from source (python setup.py install)
Example
build.py
#!/usr/bin/pythonfrompyntimporttaskfrompyntcontribimportsafe_cd, execute#TODO: write this up@task()defpwd_ls(dir="/tmp"):
'''Run "pwd followed by "ls" on a given directory'''withsafe_cd(dir):
execute('pwd')
execute("ls",dir)
__DEFAULT__=pwd_ls
Using pynt contrib
Listing the tasks in build.py
$ pynt -l
Tasks in build file build.py:
execute Executes a command through the shell. Spaces should breakup the args. Usage: execute('grep', 'TODO', '*')
pwd_ls [Default] Run "pwd followed by "ls" on a given directoryPowered by pynt 0.8.1 - A Lightweight Python Build Tool.
Note that execute is included as a task in the build scripts as a task automatically when its imported from pynt-contrib. So you can use it as any other task