loganasherjones / yapconf

Yet Another Python Configuration
http://yapconf.readthedocs.io/en/stable/
MIT License
18 stars 4 forks source link

Generate config file without bootstrap items #94

Closed hazmat345 closed 4 years ago

hazmat345 commented 5 years ago

Description

I'd like to be able to generate a config file and exclude bootstrap items.

My situation is this - I have 'configuration file' and 'configuration type' bootstrap items in my spec. It doesn't really make sense to have these in the configuration file itself, as they need to be specified in some other manner. So if they are present in the config file they aren't actually used.

I can already do what I want when migrating with spec.migrate_config_file since it has a include_bootstrap parameter. I'd like to avoid having to dump the config to a temp file and then migrate it.

loganasherjones commented 5 years ago

Hmm, I think what you're asking for is available with migrate_config_file You should just need to do:

spec.migrate_config_file('/path/to/config', create=True, include_bootstrap=False)

hazmat345 commented 5 years ago

Yeah, but it'd be cleaner for me if I didn't have to do a 'fake' migration when I do the initial generation (last paragraph in the description :smile:).

hazmat345 commented 4 years ago

Closing as this was fixed by 5295b27d. Thanks @loganasherjones!!