-
-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Global task configuration? #233
Comments
Hi @Ravencentric, thanks for sharing your use case. I've been thinking about something similar recently. In a sense this goes against what poethepoet was designed to do which is manage self contained tasks for a project in a way that all collaborators on that project can easily benefit from. However poe has some features that you could exploit to get what you want. The include global option is primarily intended for organising and reusing tasks within a monorepo, but you could also use it to include tasks from a central location like so: [tool.poe]
include = "/Users/nat/.poethepoet/common_tasks.toml" I think this accomplishes almost exactly what you're asking for. This is fine if you're the only one working on these projects, but it's not so great for collaboration since the project is no-longer self contained. If this matters to you then you could also have common tasks in a dedicated repo that you reference as a git submodule other projects and target with the include global option. Another approach which I've been thinking about improving support for would be to have essentially a normal poetry project with poe tasks somewhere like alias po="poe -C ~/.poethepoet" You can then use There's another possible approach, which is closer to what you suggested which would be to support defining a user level tasks file that is automatically included into all projects, though I'm not sure this is a good idea. It adds some complexity which could lead to surprising behaviour. What do you think? |
Thank you for the detailed answer! |
Completion scripts and list_tasks are not configurable to specify the executable name and respect the -C/--directory option. fish and zsh completion scripts now understand when the -C/--directory option has been specified and will suggest tasks from the correct project. The zsh completion script also generally handles passing multiple arguments. Addresses #233
@Ravencentric FYI since version 0.28.0 the "global tasks" solution is supported with shell completion and is documented here. |
Awesome! Thanks alot! |
Several of my projects use the same development workflow which means they also share the same commands I wanna run. Is it possible for me to define some global tasks in something like
~/poe.toml
?Now if I run
poe fmt
in a project directory with pyproject.toml it should behave no different than it would have if fmt was defined in the project's pyproject.toml. If there's a name clash, then pyproject.toml should override the global oneThe text was updated successfully, but these errors were encountered: