Watcher include directive - #1123
Open
biozz wants to merge 5 commits into
Open
Conversation
This is an attempt to implement circus-tent#1119. For now only configs and tests are added and some drafts in the config loader. This is still work in progress.
- rename config in tests - rename test case - add setting of config option from include
- Refactor read_config method with two new local methods
This was necessary to avoid code duplication, because include directive
in `[watcher]` is basically the same as in `[circus]`. This allowed the reuse of `_scan` method. I also added underscores to
arguments names, because they were shadowed.
- `_init_config` - takes config path, has a parser option with default value
and return parsed config from the path
- `_get_includes` - takes config object and section name and returns a
list of paths to read options from
- Add a required section name for watcher includes to avoid usage of a
fake `[tmp]` section from previous commits
according to [documentation](https://docs.python.org/3/library/configparser.html)
sections are required and in my opinion should be used going forward
- Expand test case to ensure included configs can be loaded from folders
and using wildcards
Contributor
Author
|
In the latest commit I introduced a new section header There was also a minor refactoring happening inside I haven't updated documentation just yet, but this should be easy, given the options are basically the same. I would appreciate any feedback on this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This can be considered as proof of concept for #1119 and it is still "work in progress".
I added support for include directive in watcher section, which is compatible across currently supported versions.