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

replacing use of deprecated ruamel.yaml.safe_load #380

Merged
merged 2 commits into from
Nov 14, 2023

Conversation

deepsihag
Copy link
Contributor

With the latest release of ruamel.yaml version 0.18.2, now safe_load is removed. In this PR updating a remaining usage of it.

@deepsihag deepsihag marked this pull request as ready for review October 27, 2023 20:25
boa/core/test.py Outdated
@@ -64,7 +64,8 @@ def get_metadata(yml, config, is_pyproject_recipe=False):

d = toml.load(fi)["tool"]["boa"]
else:
d = ruamel.yaml.safe_load(fi)
loader = YAML(typ="safe")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typ or type?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh...

Copy link

@tsibley tsibley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dependency on ruamel.yaml

boa/setup.py

Line 17 in 6aa7b7c

"ruamel.yaml",

should likely be updated to specify a minimum version to ensure the YAML(typ="safe") support is present, e.g.

ruamel.yaml >=0.15.0

if I'm reading the docs correctly about the first version to support it. (Changelog is unclear.)

boa/core/test.py Outdated
@@ -64,7 +64,8 @@ def get_metadata(yml, config, is_pyproject_recipe=False):

d = toml.load(fi)["tool"]["boa"]
else:
d = ruamel.yaml.safe_load(fi)
loader = YAML(typ="safe")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The equivalent of safe_load(…) is documented to be YAML(typ="safe", pure=True).load(…). The pure=True argument is noted in the deprecation warning and should likely be used here.

@deepsihag
Copy link
Contributor Author

How about just using ruamel.yaml >=0.18.0?

@wint3ria
Copy link

Hello, any update on this?

@wolfv wolfv merged commit 2d5d030 into mamba-org:main Nov 14, 2023
4 checks passed
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

5 participants