News for hackers. Stuff that matters.
Re:Show HN: Making GNU Make a better Task Runner by wodenokoto on Monday May 13, 2024 @09:21AM (#40343056)
Then what is a good task runner?
Re:Show HN: Making GNU Make a better Task Runner by maccard on Monday May 13, 2024 @09:43AM (#40343287)
Not OP but whatever your language/ecosystem is written in. If you're in python use python, maybe with just. If you're in ruby use rake. If you're in a polyglot environment, pick the lowest common denominator.
Re:Show HN: Making GNU Make a better Task Runner by woodrowbarlow on Monday May 13, 2024 @09:43AM (#40343282)
`just` is great, especially if you're using rust. if you're in python or javascript, it's well worth it to use a language-native runner (like pydoit / grunt). that way your "task" is just a function, it can take arguments (and you can define default values), you can even use something like `*args, **kwargs` to take any options/arguments, and then just pass them verbatim onto the subprocess.
Re:Show HN: Making GNU Make a better Task Runner by AndyKluger on Monday May 13, 2024 @01:37PM (#40345906)
For Python projects, I like to use Taskipy as the UX entry point. If any task itself is more than a one liner but doesn't need Python, I'll have it invoke a shell script from a mk folder. If any task itself requires an activated venv, I'll define it in a noxfile.

What it might look like in a pyproject.toml:

  [tool.taskipy.tasks]
  fmt = "nox -s fmt"
  lock = "nox -s lock"
  install = "if [ $VIRTUAL_ENV ]; then pip install -r local-requirements.txt; else printf '%s\n' 'Please activate a venv first'; return 1; fi"
  test = "nox -s test test_without_toml typecheck -p 3.12"
  docs = "nox -s render_readme render_api_docs"
For file generation tasks (the kind of stuff make is good at), I've been using Tup more and more. But recent versions aren't always packaged for distros, so I'm hoping it gets an asdf/mise plugin.
Re:Show HN: Making GNU Make a better Task Runner by AndyKluger on Thursday May 16, 2024 @06:16PM (#40383990)
I'm also a big fan of mise for managing development runtimes, and while I haven't tried its own task runner functionality, it does feature some: https://mise.jdx.dev/tasks/