A simple command runner disguised as a build system.
Project description
BuildMe 🛠️
Another build system. A simple command runner thats it.
What is BuildMe 🤔️
Well this pretty much sums it up.
Why???
IDK. I saw this comic and decided that I want a build system of my own.
And,
- Makefile's are shit.
- Cmake is complicated
- Meson requires two dependencies (Meson and Ninja)
- Bazel, corporate BS
It does come with some feature.
- It is just command runner (Does not give an f about the file or it's mod time)
- It's just python. Anything that works on python works on buildme script.
- you want a build script that has access to
pandas
, well you can now have it.
- you want a build script that has access to
Docs 🧾️
- Install buildme
pip3 install git+https://github.com/Adwaith-Rajesh/buildme.git
OR
pip3 install buildme
- Create a
buildme
scriptThe shebang is IMPORTANT (This thingy -> #!/bin/env buildme)
#!/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_no_zero using the
# method CommandRunner.set_exit_non_zero(vel: 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
- Make it executable
chmod +x ./buildme
- Have Fun
$ ./buildme hello
This from test
Namespace()
================================================================================
[CMD]: echo Hello World
Hello World
================================================================================
code=0
Order matters
$ ./buildme foo bar
This is the foo target
This is the bar target
$ ./buildme bar foo
This is the bar target
This is the foo target
- Helper functions
buildme
has currently two helper functions
from buildme import mkdir, touch, rmdir, rm, get_files_in_dir
Bye....
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
buildme-0.2.0.tar.gz
(5.0 kB
view hashes)
Built Distribution
Close
Hashes for buildme-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6af92e42e0271c4f163b5585d9405df65b86c008e42e92c9c824a5b398e3e46 |
|
MD5 | 82411af896e7cf42a146538ec3d641a9 |
|
BLAKE2b-256 | 11c72ad50887eeae70ea347dcc805ad63e449376ce8ca806febd037695caef48 |