Skip to content

ruamel.yaml 0.18+ compatibility: load() API removed #50

@mithro

Description

@mithro

Summary

The actions_includes module is incompatible with ruamel.yaml 0.18 and later due to a removed API.

Error

When running with ruamel.yaml >= 0.18, the following error occurs:

AttributeError: 
"load()" has been removed, use

  yaml = YAML(typ='rt')
  yaml.load(...)

and register any classes that you use, or check the tag attribute on the loaded data,
instead of file "actions_includes/__init__.py", line 818

    return yaml.load(yaml_data, Loader=RoundTripLoaderWithExp)

Root Cause

The code in actions_includes/__init__.py line 818 uses the old-style API:

return yaml.load(yaml_data, Loader=RoundTripLoaderWithExp)

This API was deprecated and then removed in ruamel.yaml 0.18 (released 2023).

Workaround

For now, users can pin to an older version of ruamel.yaml:

ruamel.yaml<0.18

Suggested Fix

Update the YAML loading code to use the new API:

from ruamel.yaml import YAML

yaml = YAML(typ='rt')  # round-trip mode
data = yaml.load(yaml_data)

This will require updating how the custom RoundTripLoaderWithExp loader is integrated, as the new API uses a different mechanism for custom constructors.

Environment

  • Python 3.13
  • ruamel.yaml 0.18+

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions