Skip to content

Replace PyYAML import with ruamel.yaml in test_common_io.py #1417

@rly

Description

@rly

Summary

tests/unit/common/test_common_io.py uses import yaml (PyYAML), but pyyaml is not a declared dependency of hdmf. The import works in pip-based environments because pip's h5py wheel transitively depends on pyyaml, but conda's h5py package does not have this transitive dependency, causing:

ModuleNotFoundError: No module named 'yaml'

This is blocking the conda-forge feedstock release: conda-forge/hdmf-feedstock#102

Failure log: https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=1479230&view=logs&jobId=7b6f2c87-f3a7-5133-8d84-7c03a75d9dfc&j=7b6f2c87-f3a7-5133-8d84-7c03a75d9dfc&t=9eb77fd2-8ddd-5444-8fc0-71cb28dcb736

Fix

Replace import yaml / yaml.safe_load() with ruamel.yaml, which is already a declared core dependency and used throughout the codebase for YAML loading.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions