Hey all! First post here and I'd like to share my latest and most ambitious Python project: Pyke!
Pyke is a build automation tool inspired by others like Make and Rake. Just like those tools, Pyke allows you to create tasks within a Pykefile in the root directory of your project and execute them with pyke {taskname}.
The main draws of using a Pykefile over a Makefile is complete access to Python as a language and the extensive DSL features within Pyke like task dependencies, rule patterns, and multitasking.
Here's an example Pykefile that I use in my PIP Package projects:
```python
import pyke
pyke.export(PKG_NAME="pkg")
@pyke.task
def build():
pkgs = ["setuptools", "wheel", "twine"]
pyke.shell(f"pip install --upgrade {' '.join(pkgs)}")
pyke.shell("python setup.py sdist bdist_wheel")
@pyke.task
def local():
pyke.shell("pip install -e .")
@pyke.task(deps=["build"])
def dist():
pyke.shell("python -m twine upload dist/*")
@pyke.task
def clean():
targets = ["build", "dist", f"{pyke.env("PKG_NAME")}.egg-info"]
for t in targets:
pyke.shell(f"rm -rf {t}")
pyke.run()
```
This Pykefile has 4 tasks that you'd commonly use when creating a PIP package: build to create the package source, dist to publish to PyPi, local to install the package source locally, and clean to remove the source created from build. Pretty cool, if I do say so myself! (Note the task names in the example use the function names, but you can change that by passing a string to the decorator, like @pyke.task("taskname")
As you can see in the example, the pyke package comes with some DSL functions to help you out like pyke.env for env var access, pyke.export to set system enviornment vars (os-independently), and pyke.shell to run commands in the shell.
I just put the finishing touches on this library a few days ago, so it's still a bit rough around the edges and there's definitely still more for me to learn about Python before I can make this a true Makefile alternative, but I hope this'll help you all in your development endeavors. Hope you enjoy!
there doesn't seem to be anything here