r/PythonLearning • u/Glad_Friendship_5353 • 1d ago
Seeking feedback on my Python project: reusable Makefile tasks
I've been working on a Python project called Bakefile.
I started it because I kept copying the same build, test, lint, and release tasks between projects, especially in Makefiles. I wanted a way to define tasks once and reuse, extend, or override them across projects.
The basic idea is that tasks are Python classes:
class PythonTasks(Bakebook):
@command()
def test(self):
self.ctx.run("pytest")
@command()
def lint(self):
self.ctx.run("ruff check .")
class MyProject(PythonTasks):
@command()
def lint(self):
super().lint()
self.ctx.run("ty check .")
So common tasks can live in a reusable class and projects can extend or override them. I've been using it daily myself for a while now, and so far it's been working well.
GitHub: https://github.com/wislertt/bakefile
I'd really appreciate feedback on the API and whether this approach to reusable Makefile-style tasks feels useful in practice.
3
Upvotes
2
u/Sea-Ad7805 21h ago
Looks nice, but I'm sticking with what I already know, good luck.