Skip to content
Snippets Groups Projects
Commit 0c7f1ab6 authored by Damian Alvarez's avatar Damian Alvarez
Browse files

To allow broader dependency replacement (not just versions, but complete

dependencies)
parent eb975a9d
Branches
No related tags found
No related merge requests found
......@@ -62,6 +62,10 @@ VETOED_INSTALLATIONS = {
TWEAKABLE_DEPENDENCIES = {
'UCX': 'default',
'CUDA': '11.5',
'Mesa': ('OpenGL', '2021b'),
'libglvnd': ('OpenGL', '2021b'),
'glu': ('OpenGL', '2021b'),
'glew': ('OpenGL', '2021b'),
}
common_site_contact = 'Support <sc@fz-juelich.de>'
......@@ -251,9 +255,23 @@ def tweak_dependencies(ec):
# being overwritten
for dep_to_tweak in TWEAKABLE_DEPENDENCIES:
for dep in dependencies:
remove = False
if dep_to_tweak in dep[0]:
list_dep = list(dep)
if isinstance(TWEAKABLE_DEPENDENCIES[dep_to_tweak], str):
list_dep[1] = TWEAKABLE_DEPENDENCIES[dep_to_tweak]
else:
# Assume that the name of the dependency also needs to be replaced, using the specified tuple
if TWEAKABLE_DEPENDENCIES[dep_to_tweak][0] not in [x[0] for x in dependencies]:
# The new dependency is not on the list, so add it
list_dep[0] = TWEAKABLE_DEPENDENCIES[dep_to_tweak][0]
list_dep[1] = TWEAKABLE_DEPENDENCIES[dep_to_tweak][1]
else:
# Remove it from the list to don't have the same dependency added N times
remove = True
if remove:
del dependencies[dependencies.index(dep)]
else:
dependencies[dependencies.index(dep)] = tuple(list_dep)
ec[dep_type] = dependencies
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment