Skip to content

Commit

Permalink
Rename parallelLegacy to _parallelLegacy
Browse files Browse the repository at this point in the history
  • Loading branch information
Flamefire committed Jun 6, 2024
1 parent cb6d60e commit 5dc1a02
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions easybuild/framework/easyblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -2245,9 +2245,9 @@ def set_parallel(self):
self.log.debug("Desired parallelism specified via 'parallel' build option: %s", par)

# Transitional only in case some easyblocks still set/change cfg['parallel']
# Use parallelLegacy to avoid deprecation warnings
# Use _parallelLegacy to avoid deprecation warnings
# Remove for EasyBuild 5.0
cfg_par = self.cfg['parallelLegacy']
cfg_par = self.cfg['_parallelLegacy']
if cfg_par is not None:
if par is None:
par = cfg_par
Expand Down
12 changes: 7 additions & 5 deletions easybuild/framework/easyconfig/easyconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def new_ec_method(self, key, *args, **kwargs):
_log.deprecated("Easyconfig parameter 'parallel' is deprecated, "
"use 'maxparallel' or the parallel property instead.", '5.0')
# Use a "hidden" property for now to match behavior as closely as possible
key = 'parallelLegacy'
key = '_parallelLegacy'
elif key in DEPRECATED_PARAMETERS:
depr_key = key
key, ver = DEPRECATED_PARAMETERS[depr_key]
Expand All @@ -145,7 +145,9 @@ def is_local_var_name(name):
"""
res = False
if name.startswith(LOCAL_VAR_PREFIX) or name.startswith('_'):
res = True
# Remove with EasyBuild 5.0
if name != '_parallelLegacy':
res = True
# __builtins__ is always defined as a 'local' variables
# single-letter local variable names are allowed (mainly for use in list comprehensions)
# in Python 2, variables defined in list comprehensions leak to the outside (no longer the case in Python 3)
Expand Down Expand Up @@ -519,7 +521,7 @@ def __init__(self, path, extra_options=None, build_specs=None, validate=True, hi
# Storage for parallel property. Mark as unset initially
self._parallel = None
# Legacy value, remove with EasyBuild 5.0
self._config['parallelLegacy'] = [None, '', ('', )]
self._config['_parallelLegacy'] = [None, '', ('', )]

# parse easyconfig file
self.build_specs = build_specs
Expand Down Expand Up @@ -726,7 +728,7 @@ def parse(self):
if 'parallel' in ec_vars:
# Replace value and issue better warning for EC params (as opposed to warnings meant for easyblocks)
self.log.deprecated("Easyconfig parameter 'parallel' is deprecated, use 'maxparallel' instead.", '5.0')
ec_vars['parallelLegacy'] = ec_vars.pop('parallel')
ec_vars['_parallelLegacy'] = ec_vars.pop('parallel')

# provide suggestions for typos. Local variable names are excluded from this check
possible_typos = [(key, difflib.get_close_matches(key.lower(), self._config.keys(), 1, 0.85))
Expand Down Expand Up @@ -1248,7 +1250,7 @@ def parallel(self, value):
self._parallel = value
self.template_values['parallel'] = value
# Backwards compat only. Remove with EasyBuild 5.0
self._config['parallelLegacy'][0] = value
self._config['_parallelLegacy'][0] = value

def dump(self, fp, always_overwrite=True, backup=False, explicit_toolchains=False):
"""
Expand Down

0 comments on commit 5dc1a02

Please sign in to comment.