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:
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:
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
The need to 100% backwards-compatible behaviour matching is not as important as the unification of the libraries, which means PyYAML should be deprecated
We leave this as is, as a proof of concept for future reference, in case it's useful.
Checklist
news
entryOne 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:https://github.com/conda-forge/conda-smithy/blob/9e4720fc497f45f45d7bd319a354c762992c530d/conda_smithy/variant_algebra.py#L55
https://github.com/conda-forge/conda-smithy/blob/9e4720fc497f45f45d7bd319a354c762992c530d/conda_smithy/configure_feedstock.py#L2608
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:
Thank you for your feedback