cmake-format-precommit icon indicating copy to clipboard operation
cmake-format-precommit copied to clipboard

Missing dependency to `PyYAML`

Open LecrisUT opened this issue 2 years ago • 4 comments
trafficstars

Some commands seem to require it, i.e. https://github.com/cheshirekow/cmake_format/blob/eff5df1f41c665ea7cac799396042e4f406ef09a/cmakelang/format/main.py#L208-L220

These should be included in this precommit package

LecrisUT avatar Jan 26 '23 13:01 LecrisUT

Yeah, I am facing this issue as well:

  File "/Users/gegles/.cache/pre-commit/repoqbs4vry3/py_env-python3.11/lib/python3.11/site-packages/cmakelang/format/__main__.py", line 359, in get_config
    return get_configdict(configfile_paths)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/gegles/.cache/pre-commit/repoqbs4vry3/py_env-python3.11/lib/python3.11/site-packages/cmakelang/format/__main__.py", line 312, in get_configdict
    increment_dict = get_one_config_dict(configfile_path)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/gegles/.cache/pre-commit/repoqbs4vry3/py_env-python3.11/lib/python3.11/site-packages/cmakelang/format/__main__.py", line 287, in get_one_config_dict
    return load_yaml(config_file)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/gegles/.cache/pre-commit/repoqbs4vry3/py_env-python3.11/lib/python3.11/site-packages/cmakelang/format/__main__.py", line 212, in load_yaml
    import yaml
ModuleNotFoundError: No module named 'yaml'

gegles avatar Jan 23 '24 17:01 gegles

@LecrisUT, is there a workaround?

gegles avatar Jan 23 '24 18:01 gegles

You can add it to additional_dependencies or fork this, add dependencies/install_requires in setup.py make a PR and link to that in the meantime

LecrisUT avatar Jan 23 '24 18:01 LecrisUT

Scrap the latter: https://github.com/cheshirekow/cmake-format-precommit/pull/4. Just link to that fork will be ok

LecrisUT avatar Jan 23 '24 18:01 LecrisUT