That would be invoke tasks. https://docs.pyinvoke.org/en/stable/getting-started.html, which I first encountered in fabric: fabfile.org, which has the fab utility and fabfiles (analogous to Makefiles) but is so much more.
btw, the project is old and it is useful with the current feature set. There is an issue with the bus factor but is common for many tools.