DOIT_CONFIG from pyproject.toml?

21 views
Skip to first unread message

Nicholas Bollweg

unread,
Oct 27, 2020, 10:52:08 PM10/27/20
to python-doit
What are the community thoughts around being able to put DOIT_CONFIG in pyproject.toml? While not _quite_ as varied as YAML (and not, somehow, in stdlib), there are a few ways one could type it out, but something like this seems about right:

[tools.doit.DOIT_CONFIG]
GLOBAL = {
  optx = 6,
  opty = 7,
}
COMMAND = {
  foo = "tests.sample_plugin:MyCmd"
}

For reference, pytest first checks for pytest.ini, then pyproject.toml and so on, while black requires it (though it has a switch if you _really_ want black.toml).

This could be demoed as a plugin/wrapper (e.g. doit-toml-config-loader), but as a "first-class" file, it might make sense as a PR to core doit.

Some background: on a number of repos, I've been looking towards consolidating my config/dotfiles. pyproject.toml seems to not be going anywhere, with least some support in most python tools.

Aside from that: I have been starting to use config_changed with "slices" of pyproject.toml and have been pretty happy with the results. Going further, it seems like pyproject.toml might end up being a good place to store doit task definitions, a la doit-yaml, but hopefully with less ceremony and weird no==norway edge cases.

And to the contributors/maintainers: thanks for doit!

Eduardo Schettino

unread,
Oct 27, 2020, 11:01:36 PM10/27/20
to python-doit
On Wed, Oct 28, 2020 at 10:52 AM Nicholas Bollweg <nick.b...@gmail.com> wrote:
What are the community thoughts around being able to put DOIT_CONFIG in pyproject.toml?

Hi,

doit maintainer here :)
I guess it would be nice. Makes sense to add support into doit core.

Is there a friendlier description of pyproject.toml apart from the PEP?
Regarding details of implementation I do not have any opinions yet...
Please open an issue on github and we go on from there.

Cheers,

Reply all
Reply to author
Forward
0 new messages