Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 765 - Update to ruamel.yaml 0.17, use new API #806

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jwhitlock
Copy link

This PR reimplements YAML loading and unloading using the ruamel.yaml API introduced in 0.15. The older PyYAML-based API is deprecated in 0.17. This fixes issue #765 and the deprecation warnings.

Much of the YAML code was in the initial commit in 2017. Since then, ruamel.yaml has implemented fixes and features that removes the need for a lot of the custom code.

I tested by:

  • Running the test suite with tox
  • Running the testproj app before and after the change. The YAML is identical.

0.17.0 drops Python 2.7 support, and sets 3.5 as the minimum. Adds a
deprecation warning for dump() and load(), used in codec.py. This is
followed by rapid releases to 0.17.2 to fix packaging issues.
Convert from `yaml.load` and `yaml.dump` to a YAML instance, and
prefer features in that library.

* SaneYamlDumper becomes SaneYamlRepresenter, based on SafeRepresenter
* increase_indent is dropped in favor of calling indent()
* represent_odict is dropped in favor of using represent_dict with
  setting sort_base_mapping_on_output to FalseA
* Drop block style for bytes
* Encode to binary after processing, rather than setting on YAML
  instance
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.

None yet

1 participant