cannot use .yml configuration
There is a missing point in the code, that avoids using .yml files for worker configuration (but it works with .yaml)
Line 78 in https://gitlab.esrf.fr/workflow/ewoks/ewoksjob/-/blob/main/src/ewoksjob/config.py?ref_type=heads
if ext in (".yaml", "yml"):
In [1]: from ewoksjob.config import read_configuration, get_cfg_type
In [2]: get_cfg_type("/data/scisoft/edgar/ewoks/config_local.yaml")
Out[2]: 'yaml'
In [3]: get_cfg_type("/data/scisoft/edgar/ewoks/config_local.yml")
Out[3]: 'python'
In [4]: read_configuration("/data/scisoft/edgar/ewoks/config_local.yaml")
Out[4]:
{'broker_url': 'redis://localhost:10002/3',
'result_backend': 'redis://localhost:10002/4',
'result_serializer': 'pickle',
'accept_content': ['application/json', 'application/x-python-serialize'],
'result_expires': 600,
'task_remote_tracebacks': True}
In [5]:
In [5]: read_configuration("/data/scisoft/edgar/ewoks/config_local.yml")
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[5], line 1
----> 1 read_configuration("/data/scisoft/edgar/ewoks/config_local.yml")
File ~/anaconda3/envs/blissdata/lib/python3.9/site-packages/ewoksjob/config.py:101, in read_configuration(cfg_uri)
99 config = _read_yaml_config(cfg_uri)
100 elif file_type == "python":
--> 101 config = _read_py_config(cfg_uri)
102 else:
103 raise ValueError(f"Configuration URL '{cfg_uri}' is not supported")
File ~/anaconda3/envs/blissdata/lib/python3.9/site-packages/ewoksjob/config.py:155, in _read_py_config(cfg_uri)
153 sys.path.insert(0, sys_path)
154 try:
--> 155 config = vars(importlib.import_module(module))
156 config = {
157 k: v
158 for k, v in config.items()
159 if not k.startswith("_") and not isinstance(v, types.ModuleType)
160 }
161 return config
File ~/anaconda3/envs/blissdata/lib/python3.9/importlib/__init__.py:127, in import_module(name, package)
125 break
126 level += 1
--> 127 return _bootstrap._gcd_import(name[level:], package, level)
File <frozen importlib._bootstrap>:1030, in _gcd_import(name, package, level)
File <frozen importlib._bootstrap>:1007, in _find_and_load(name, import_)
File <frozen importlib._bootstrap>:984, in _find_and_load_unlocked(name, import_)
ModuleNotFoundError: No module named 'config_local'
Edited by Edgar Gutierrez