Closed gorun2git closed 1 year ago
For the anchor issue I found that by default pyyaml doesn't easily allow you to carry anchors between files. I actually have an open PR to get this exact functionality working https://github.com/tanbro/pyyaml-include/pull/32
For the !include document tag I don't think !include can be used as a key by default only as a value.
@NoahFeinberg, thank you for your quick reply.
I think your pr will be great addition to the library.
Hi,
I've started playing around with this interesting library and I have a question. I'm not sure if this can be an issue or maybe I missed the point. So let me explain what I want to build.
My environment: python=3.10.10 PyYAML=6.0 pyyaml-include=1.3
What I've tried so far: I want to create some defaults that would be use across the YAML config files without need to copy it multiple times in different blocks with possibly with anchors. So, if I have /test/path/custom-defaults/person.yaml file:
And I'd like to include it in other config files, e.g. in /test/path/defaults/describe-people.yaml:
When try this I'm getting an error:
raise ParserError(None, None, yaml.parser.ParserError: expected '<document start>', but found '<block mapping start>'
On the other side, I can fix it by:
Questions: Is it even possible to use it as a document tag and if yes, can someone provide an example?
Thank you.