Skip to content

refactor: ruamel#1964

Draft
AlbaHerrerias wants to merge 8 commits intoconda-forge:mainfrom
neighbourhoodie:refactor/yaml_ruamel
Draft

refactor: ruamel#1964
AlbaHerrerias wants to merge 8 commits intoconda-forge:mainfrom
neighbourhoodie:refactor/yaml_ruamel

Conversation

@AlbaHerrerias
Copy link
Copy Markdown

Checklist

  • Added a news entry

One of the tasks in our STF work for Conda is to modernize conda-smithy's codebase. A work item is to unify the two YAML libraries currently in use: ruamel and PyYAML. We were advised to replace PyYAML with ruamel, as ruamel preserves comments in YAML documents. However, we found that the usage of PyYAML's BaseLoader in these two places:

content = yaml.load(contents, Loader=yaml.loader.BaseLoader) or {}

yaml.load(contents, Loader=yaml.loader.BaseLoader) or {}

are crucial to the current behaviour of conda-smithy, because it preserves all keys and values as strings, rather than parsing them. We believe this is necessary to prevent mishandling unquoted version numbers. Unfortunately, we were unable to replicate this behaviour using ruamel.

The possible outcomes we see so far for this work are:

  1. The preservation of comments are not as important as the unification of the libraries, which means ruamel should be the one being deprecated in favour of PyYAML
  2. The need to 100% backwards-compatible behaviour matching is not as important as the unification of the libraries, which means PyYAML should be deprecated
  3. We leave this as is, as a proof of concept for future reference, in case it's useful.

Thank you for your feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants