Skip to content
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

Importing tasks from external tasks file #44

Closed
kghenderson opened this issue Dec 19, 2021 · 4 comments
Closed

Importing tasks from external tasks file #44

kghenderson opened this issue Dec 19, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@kghenderson
Copy link

Not sure if this is already possible, but don't see it mentioned anywhere yet.

Ideally I'd like to include some tasks for my package (A) and be able to import them as local tasks (B).
Alternatively, it may be simpler to have a local tasks subdirectory (B) and copy/sync the mypackage.tasks (from A).

The challenge is that pyproject.toml is large and manually syncing these tasks can be error-prone and tedious.
This could also open the possibility of writing a script to generate those tasks based on the local configuration.
While it could probably be done by editing pyproject.toml directly, a separate file would be a lot safer.

Thanks for considering.
Kevin

@nat-n
Copy link
Owner

nat-n commented Dec 19, 2021

Hi Kevin,
@kghenderson

I'm not sure I've understood what you're describing.

But something I have been considering is allowing tasks to be defined in a separate toml file within the same project by specifying something like tool.poe.include = "tasks.toml". The use cases I had in mind were to better support having a large number of tasks, or sharing tasks between projects via a git submodule. I guess the other toml file could even be dynamically generated.

Would this work for your use case?


Also in case it's relevant you can edit a toml file in place the same way that poetry does using tomlkit

@kghenderson
Copy link
Author

kghenderson commented Dec 19, 2021 via email

@nat-n nat-n added the enhancement New feature or request label Dec 19, 2021
@nat-n
Copy link
Owner

nat-n commented Jan 8, 2022

This feature has just been released as part of 0.12.0

@kghenderson I hope it works well for you :)

@nat-n nat-n closed this as completed Jan 8, 2022
@kghenderson
Copy link
Author

That's awesome @nat-n ! Thank you so much, can't wait to try it out!

Kevin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants