Buildme

Latest version: v0.3.4

Safety actively analyzes 623983 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.3.1

Targets now runs on empty depends when invoked
(`target(depends=[])`)

What's Changed
* Errors by Adwaith-Rajesh in https://github.com/Adwaith-Rajesh/buildme/pull/3


**Full Changelog**: https://github.com/Adwaith-Rajesh/buildme/compare/v0.3.0...v0.3.1

0.3.0

targets now depend on the mtime of the files.
target can now mention the file depends on and the files its creates

more docs [here](https://github.com/Adwaith-Rajesh/buildme/blob/master/docs/buildme.md)

What's Changed
* Mtime by Adwaith-Rajesh in https://github.com/Adwaith-Rajesh/buildme/pull/2


**Full Changelog**: https://github.com/Adwaith-Rajesh/buildme/compare/v0.2.0...v0.3.0

0.2.0

- 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

0.1.0

Have you ever wondered what happens if you combine build systems, stupidity and python well you get
[BuildMe](https://github.com/Adwaith-Rajesh/buildme).

The most simplest, weirdest Build System (:billed_cap: it's just a command runner disguised as a build system) .
Here is a small excerpt from the README on how to use it.

- Install buildme

console
pip3 install buildme


- Create a `buildme` script
> The shebang is IMPORTANT (This thingy -> !/bin/env buildme)

python
!/bin/env buildme
from argparse import Namespace for type hinting purposes only
from buildme import CommandRunner


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
exit_non_zero=True, exit the buildme execution if a command exits non zero
)

you can override the exit_no_zero using the
method CommandRunner.set_exit_non_zero(vel: bool)


def hello(opts: Namespace):
print(opts)
code = cr.run('echo Hello World')
print(f'{code=}')


def test(opts: Namespace):
if opts.release == '0':
print('release is zero')
print('This from test')



- Make it executable

console
chmod +x ./buildme


And then the fun stuff
execute the script
console
$ ./buildme hello test --release=0
Namespace(release='0')
================================================================================
[CMD]: echo Hello World
Hello World
================================================================================
code=0
release is zero
This from test

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.