Skip to content

Commit a41de82

Browse files
committed
suggest 'extract' as as correct step name instead of 'source' when used in skipsteps
1 parent f41ef28 commit a41de82

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

easybuild/framework/easyconfig/easyconfig.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
from easybuild.tools.filetools import convert_name, copy_file, create_index, decode_class_name, encode_class_name
7373
from easybuild.tools.filetools import find_backup_name_candidate, find_easyconfigs, load_index
7474
from easybuild.tools.filetools import read_file, write_file
75-
from easybuild.tools.hooks import PARSE, STEP_NAMES, load_hooks, run_hook
75+
from easybuild.tools.hooks import PARSE, EXTRACT_STEP, STEP_NAMES, load_hooks, run_hook
7676
from easybuild.tools.module_naming_scheme.mns import DEVEL_MODULE_SUFFIX
7777
from easybuild.tools.module_naming_scheme.utilities import avail_module_naming_schemes, det_full_ec_version
7878
from easybuild.tools.module_naming_scheme.utilities import det_hidden_modname, is_valid_module_name
@@ -871,6 +871,10 @@ def validate(self, check_osdeps=True):
871871
error_line = "* %s" % step
872872
# try to find close match, may be just a typo in the step name
873873
close_matches = difflib.get_close_matches(step, STEP_NAMES, 2, 0.8)
874+
# 'source' step was renamed to 'extract' in EasyBuild 5.0, see provide a useful suggestion in that case;
875+
# see https://github.com/easybuilders/easybuild-framework/pull/4629
876+
if not close_matches and step == 'source':
877+
close_matches.append(EXTRACT_STEP)
874878
if close_matches:
875879
error_line += " (did you mean %s?)" % ', or '.join("'%s'" % s for s in close_matches)
876880
error_lines.append(error_line)

easybuild/tools/hooks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
CLEANUP_STEP = 'cleanup'
4545
CONFIGURE_STEP = 'configure'
4646
EXTENSIONS_STEP = 'extensions'
47+
EXTRACT_STEP = 'extract'
4748
FETCH_STEP = 'fetch'
4849
INSTALL_STEP = 'install'
4950
MODULE_STEP = 'module'
@@ -55,7 +56,6 @@
5556
PREPARE_STEP = 'prepare'
5657
READY_STEP = 'ready'
5758
SANITYCHECK_STEP = 'sanitycheck'
58-
EXTRACT_STEP = 'extract'
5959
TEST_STEP = 'test'
6060
TESTCASES_STEP = 'testcases'
6161

test/framework/options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ def test_skipsteps(self):
411411
# see https://github.com/easybuilders/easybuild-framework/pull/4629
412412
test_ec_txt += "\nskipsteps = ['source']\n"
413413
write_file(test_ec, test_ec_txt)
414-
error_pattern = error_pattern.replace('wrong-step-name', 'source')
414+
error_pattern = error_pattern.replace('wrong-step-name', r"source \(did you mean 'extract'\?\)")
415415
self.assertErrorRegex(EasyBuildError, error_pattern, self.eb_main, args, do_build=True, raise_error=True)
416416

417417
# check use of skipsteps to skip sanity check

0 commit comments

Comments
 (0)