mxcube / mxcubecore

Backend used by MXCuBE
http://mxcube.github.io/mxcube/
GNU Lesser General Public License v3.0
11 stars 51 forks source link

`ruamel.yaml` vs. `PyYAML`? #921

Open fabcor-maxiv opened 2 months ago

fabcor-maxiv commented 2 months ago

@rhfogh wrote:

One question: There is also an import yaml in HardwareObjects.StateMachine. Should that also be modified?

-- https://github.com/mxcube/mxcubecore/pull/920#pullrequestreview-2009186086

In my environment, import yaml imports the yaml import package installed by the PyYaml distribution package. But PyYAML is not declared as direct dependency in pyproject.toml, which is a bad thing. Obviously, all direct dependencies (the things we import directly) should all be declared in pyproject.toml.

In my environment, it happens that PyYAML is installed as a dependency of pre-commit (and also Sphinx-related things, but that is relatively new, while pre-commit has been here longer). So things work fine, but...

  1. If we depend on PyYAML, we should declare it so in pyproject.toml.
  2. Maybe we do not need to depend on both Yaml libraries: ruamel.yaml and PyYAML.