Always pass a Loader argument to yaml.load #274
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since PyYAML 5.1, calling
yaml.load()
without specifying aLoader
argument is deprecated. With the release of PyYAML 6.0 yesterday, theLoader
is now a mandatory positional argument.This causes
scc
commands loading YAML configurations e.g.merge --repository-config
(see https://merge-ci.openmicroscopy.org/jenkins/job/BIOFORMATS-push/1006/console ) or the newly introducedbump-conda-version
to fail on newly created environments - see also yaml/pyyaml#576This PR adjusts all usages of
yaml.load()
to passLoader=yaml.FullLoader
which is equivalent to the former call. This should make the library compatible with both PyYAML 5.x and PyYAML 6.x. The alternative would be to cap PyYAML to 5.x but this feels like a minimal change to maintain compatibility between both lines. The only open question is around the loader to use. feb2c22 uses theFullLoader
which is identical to the previous call but there might be a case for tightening it toSafeLoader
.To test this PR:
/path/to/venv/bin/pip install scc
- this should installPyYAML 6.0
scc
in the same virtual environment/path/to/venv/bin/pip install .
Running the same command as above should now execute the command as expected