fix(config): move to pyyaml-include 2.x, keep legacy CWD-relative !include #642
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.
Summary
This PR updates the yaml-include dependency from 1.4.1 to 2.x while preserving backward compatibility for existing configurations. Version 1.4.1 does not seem to be a public release, and version 1.x is not supported from what I can tell.
The goal is to get this onto 2.x (which is not backward compatible, due to a new API / inclusion of fsspec) with a minimal amount of changes.
Please let me know if you'd like additional tests, or if there are other considerations related to these inclusions / yaml usage. Thanks!
Changes
YamlIncludeConstructor.add_to_loader_class
withyaml.add_constructor
base_dir=os.getcwd()
to preserve prior relative-include semanticspyyaml-include>=2,<3
to use the supported 2.x API!include
constructor is properly registeredTesting
!include
statements load correctlyBackward Compatibility
This change should maintain full backward compatibility:
!include
statements continue to work