- Now only function that are decorated with `target` can be called from the CLI
- targets can now depend on other targets
soooo.
python
!/bin/env buildme
from argparse import Namespace for type hinting purposes only
from buildme import CommandRunner, target
cr = CommandRunner(
shell=False, prevents invoking 'mystery' programs (default=False)
print_cmd=True, prints the command that is currently being executed (default=True)
print_cmd_sep=True, prints a separation line between the commands that are ran (default=True)
exit_non_zero=True, exit the buildme execution if a command exits non zero (default=True)
)
you can override the exit_non_zero using the
method CommandRunner.set_exit_non_zero(val: bool)
target(depends=['test'])
def hello(opts: Namespace, _):
print(opts)
code = cr.run('echo Hello World')
print(f'{code=}')
target()
def test(opts: Namespace, _):
if getattr(opts, 'release', None) is not None and opts.release == '0':
print('release is zero')
print('This from test')
target()
def foo(_, __):
print('This is the foo target')
target()
def bar(_, __):
print('This is the bar target')
target(depends=['test'])
def all(_, __): pass
What's Changed
* Target by Adwaith-Rajesh in https://github.com/Adwaith-Rajesh/buildme/pull/1
New Contributors
* Adwaith-Rajesh made their first contribution in https://github.com/Adwaith-Rajesh/buildme/pull/1
**Full Changelog**: https://github.com/Adwaith-Rajesh/buildme/compare/v0.1.0...v0.2.0