Skip to content

CMake doesn't check for ruamel.yaml Python Module #48

@bpadalino

Description

@bpadalino

CMake doesn't check if the ruamel.yaml Python module is installed. UHD checks for it in the following way:

set(RUAMEL.YAML_MIN_VERSION "0.15")
PYTHON_CHECK_MODULE(
    "ruamel.yaml ${RUAMEL.YAML_MIN_VERSION} or greater"
    "ruamel.yaml" "LooseVersion(ruamel.yaml.__version__) >= LooseVersion('${RUAMEL.YAML_MIN_VERSION}')"
    HAVE_PYTHON_MODULE_YAML
)

Where PYTHON_CHECK_MODULE comes from UHDPython.cmake which isn't installed with UHD, but comes from UHD.

In some test files (python_api_test.py and uhd_test_base.py), UHD does the following:

try:
    from ruamel import yaml
except:
    import yaml

Is the ruamel.yaml Python module really required, or is it just nice to have? Can the try/except import work for this dependency? If not, should UHDPython.cmake be installed by UHD, or should the macro just come over to this repository?

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