Skip to content

Load defaults with configvars and keep defined parser arguments #311

Answered by yaythomas
yt-invers asked this question in Q&A
Discussion options

You must be logged in to vote

Goodness, I don't even know where ChatGPT would have got that from! I don't recognise the flag name at all! (If someone somewhere wrote some extension like this, feel free to get in touch!)

Yes, you're right @yt-invers, pypyr.steps.configvars will always overwrite on update - so it will overwrite cli arguments.

Configvars does a bit more than just loading from yaml - it interacts with the pypyr config system, checks multiple file locations and also pyproject.toml.

If you're happy just to load from a specific yaml file, you can do this:

context_parser: pypyr.parser.keyvaluepairs
steps:
  - name: pypyr.steps.fetchyaml    
    in:
      fetchYaml:
        path: my-file.yaml
        key: defa…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@yt-invers
Comment options

Answer selected by yt-invers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants