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

create class variable to hold config file entries prefix #419

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

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
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.

None yet

2 participants