nat-n / poethepoet

A task runner that works well with poetry.
https://poethepoet.natn.io/
MIT License
1.4k stars 58 forks source link

namespace support with include #110

Closed jnoortheen closed 1 year ago

jnoortheen commented 1 year ago

It would be good to have support for nested tasks. In a monorepo, subproject's tasks need to be run in their own directory. Calling them from the root directory will be convenient.

Example: https://taskfile.dev/usage/#including-other-taskfiles , this accepts dir: argument as well. That will be used as the workdir for the nested tasks

nat-n commented 1 year ago

Hi @jnoortheen, thanks for the feedback. Monorepo support is something I'd like poe to be better at.

Have you tried achieving this with the include option, combined with the cwd option?

Does that do what you want or is there something missing? I guess the way cwd works is a bit limited here because poe doesn't explicitly keep track of the location of the file the task was defined in, when what you really want is to set something like: cwd = "${TASK_FILE_DIR}", and maybe also to be able to configure this per pyproject.toml rather than per task?

jnoortheen commented 1 year ago

@nat-n thanks for the quick reply. I did try include option, it would be cumbersome to define the cwd on the included task file. Since I am converting from taskfile.yml I expected the include to accept a table with cwd option. It would be easier to call tasks from sub-modules.

nat-n commented 1 year ago

Yea, that makes sense. It'll be in the next release soon :)

nat-n commented 1 year ago

@jnoortheen This feature is now available as part of v0.17.0.

jnoortheen commented 1 year ago

Looks neat. Thanks!