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

Are there config file includes (do config file attributes get parsed when they're in yaml) #272

Open
ridilculous opened this issue Apr 27, 2022 · 2 comments

Comments

@ridilculous
Copy link

Maybe this is already possible and i just don't know how to use it.

Is there a way for a config file to include another config file, i.e. split and reuse config files partially?

Multiple config files can be configured and they are recognized when they're all passed through command line, but whatever i try, i cannot specify the same or another config file within a existing config file.

Here's what i tried:

Parser fragment:

parser.add("-cfg", "--configFile", is_config_file=True)
parser.add("-cfg2", "--configFile2", is_config_file=True)
  • Works, i.e. reads both config files:
    test.py --configFile "test.yaml" --configFile2 "test2.yaml"

  • Doesn't read "test2.yaml":
    test.py --configFile "test.yaml"
    test.yaml:
    configFile: "test2.yaml"

  • Also doesn't read "test2.yaml":
    test.py --configFile "test.yaml"
    test.yaml:
    configFile2: "test2.yaml"

@kyduff
Copy link

kyduff commented Jul 29, 2022

I am also looking for the same functionality. Perhaps support for the !includes directive is a worthy feature? Something as in this stackoverflow example could be very useful.

@bw2
Copy link
Owner

bw2 commented Jul 23, 2023

A PR to add this would be appreciated.

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

No branches or pull requests

3 participants