Skip to content

Conversation

castalheiro
Copy link

@castalheiro castalheiro commented Mar 5, 2022

I intend to customize the configuration file entries prefix (e.g.tool.myapp.tasks.make_cookies instead of tool.doit.tasks.make_cookies). However, there is no global setting to replace all "doit" references with my own application name. Therefore i ended up creating a class variable that i can later modify without having to subclass DoitMain and DoitConfig classes.

This documentation page (https://pydoit.org/configuration.html#tool-doit-tasks) provides an example of the default setting.

@schettino72
Copy link
Member

Hey, this is a good use-case.

Right now the code assumes tool.doit prefix for pyproject.toml and no prefix for other names of TOML files...
Since we are making the prefix configurable it would be better to make it configurable on every case (whatever TOML file name).

Are you sub-classing DoitMain? I would think it makes more sense to make the configuration by changes in DoitMain instead of DoitConfig.

Copy link
Member

@schettino72 schettino72 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Configurable through DoitMain instead of DoitConfig
  • Flexible prefix configuration for any TOML filename (not only pyproject.toml)

@castalheiro castalheiro force-pushed the create-class-variable-for-config-files-prefix branch from 1c01b5d to 8d297b2 Compare March 13, 2022 12:09
@castalheiro castalheiro requested a review from schettino72 April 22, 2022 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants