Skip to content
Snippets Groups Projects
Commit dfee2e90 authored by Blaise Li's avatar Blaise Li
Browse files

Trying to fix infinite recursion error.

parent e7c9e8fd
No related branches found
No related tags found
No related merge requests found
__copyright__ = "Copyright (C) 2020 Blaise Li"
__licence__ = "GNU GPLv3"
__version__ = 0.6
__version__ = 0.6.1
from .libworkflows import (
SHELL_FUNCTIONS, cleanup_and_backup, column_converter,
ensure_relative, envmods,
......
......@@ -221,26 +221,22 @@ def run_with_modules(
def envmods(
mod_name,
module_versions,
dependency=None):
module_versions):
"""
Generate a list of string representing the modules to be loaded.
*mod_name* will be used as a key in the *module_versions*
dictionary in order to get the associated version number.
If *dependency* is set, it is assumed that the dictionary
entry for *mod_name* is actually a sub-dictionary of dependencies
for module *mod_name* (including *mod_name* itself) where
*dependency* will be found as a key.
If the dictionary entry for *mod_name* is actually a sub-dictionary
of dependencies for module *mod_name* (including *mod_name* itself),
the list of modules will be those in this sub-dictionary.
"""
if isinstance(module_versions[mod_name], Mapping):
return list(chain.from_iterable(
envmods(mod_name, module_versions, dependency=dependency)
envmods(dependency, module_versions[mod_name])
for dependency in module_versions[mod_name]))
if dependency is None:
return [f"{mod_name}/{module_versions[mod_name]}"]
return [f"{dependency}/{module_versions[mod_name][dependency]}"]
return [f"{mod_name}/{module_versions[mod_name]}"]
def run_and_write_methods(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment