Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove deprecated fetch_extension_sources #4245

Merged
merged 1 commit into from
Apr 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions easybuild/framework/easyblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,14 +533,6 @@ def fetch_patches(self, patch_specs=None, extension=False, checksums=None):
else:
self.log.info("Added patches: %s", self.patches)

def fetch_extension_sources(self, skip_checksums=False):
"""
Fetch source and patch files for extensions (DEPRECATED, use collect_exts_file_info instead).
"""
depr_msg = "EasyBlock.fetch_extension_sources is deprecated, use EasyBlock.collect_exts_file_info instead"
self.log.deprecated(depr_msg, '5.0')
return self.collect_exts_file_info(fetch_files=True, verify_checksums=not skip_checksums)

def collect_exts_file_info(self, fetch_files=True, verify_checksums=True):
"""
Collect information on source and patch files for extensions.
Expand Down
2 changes: 1 addition & 1 deletion easybuild/framework/easyconfig/easyconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ def count_files(self):
for ext in self['exts_list']:
if isinstance(ext, tuple) and len(ext) >= 3:
ext_opts = ext[2]
# check for 'sources' first, since that's also considered first by EasyBlock.fetch_extension_sources
# check for 'sources' first, since that's also considered first by EasyBlock.collect_exts_file_info
if 'sources' in ext_opts:
cnt += len(ext_opts['sources'])
elif 'source_tmpl' in ext_opts:
Expand Down
29 changes: 1 addition & 28 deletions test/framework/easyblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -2443,13 +2443,6 @@ def test_checksum_step(self):
error_msg = "Checksum verification for extension source bar-0.0.tar.gz failed"
self.assertErrorRegex(EasyBuildError, error_msg, eb.collect_exts_file_info)

# also check with deprecated fetch_extension_sources method
self.allow_deprecated_behaviour()
self.mock_stderr(True)
self.assertErrorRegex(EasyBuildError, error_msg, eb.fetch_extension_sources)
self.mock_stderr(False)
self.disallow_deprecated_behaviour()

# create test easyconfig from which checksums have been stripped
test_ec = os.path.join(self.test_prefix, 'test.eb')
ectxt = read_file(toy_ec)
Expand Down Expand Up @@ -2497,17 +2490,10 @@ def test_checksum_step(self):
error_msg = "Checksum verification for .*/toy-0.0.tar.gz using .* failed"
self.assertErrorRegex(EasyBuildError, error_msg, eb.checksum_step)

# also check verification of checksums for extensions, which is part of fetch_extension_sources
# also check verification of checksums for extensions, which is part of collect_exts_file_info
error_msg = "Checksum verification for extension source bar-0.0.tar.gz failed"
self.assertErrorRegex(EasyBuildError, error_msg, eb.collect_exts_file_info)

# also check with deprecated fetch_extension_sources method
self.allow_deprecated_behaviour()
self.mock_stderr(True)
self.assertErrorRegex(EasyBuildError, error_msg, eb.fetch_extension_sources)
self.mock_stderr(False)
self.disallow_deprecated_behaviour()

# if --ignore-checksums is enabled, faulty checksums are reported but otherwise ignored (no error)
build_options = {
'ignore_checksums': True,
Expand All @@ -2534,19 +2520,6 @@ def test_checksum_step(self):
self.assertEqual(stdout, '')
self.assertEqual(stderr.strip(), "WARNING: Ignoring failing checksum verification for bar-0.0.tar.gz")

# also check with deprecated fetch_extension_sources method
self.allow_deprecated_behaviour()
self.mock_stderr(True)
self.mock_stdout(True)
eb.fetch_extension_sources()
stderr = self.get_stderr()
stdout = self.get_stdout()
self.mock_stderr(False)
self.mock_stdout(False)
self.assertEqual(stdout, '')
self.assertTrue(stderr.strip().endswith("WARNING: Ignoring failing checksum verification for bar-0.0.tar.gz"))
self.disallow_deprecated_behaviour()

def test_check_checksums(self):
"""Test for check_checksums_for and check_checksums methods."""
testdir = os.path.abspath(os.path.dirname(__file__))
Expand Down
2 changes: 1 addition & 1 deletion test/framework/easyconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -4710,7 +4710,7 @@ def test_count_files(self):
' ("test-ext-one", "0.0", {',
' "sources": ["test-ext-one-0.0-part1.tgz", "test-ext-one-0.0-part2.zip"],',
# if both 'sources' and 'source_tmpl' are specified, 'source_tmpl' is ignored,
# see EasyBlock.fetch_extension_sources, so it should be too when counting files
# see EasyBlock.collect_exts_file_info, so it should be too when counting files
' "source_tmpl": "test-ext-one-%(version)s.tar.gz",',
' }),',
' ("test-ext-two", "0.0", {',
Expand Down