Skip to content
Merged
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
22 changes: 19 additions & 3 deletions easybuild/easyblocks/e/easybuildmeta.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,23 @@ def __init__(self, *args, **kwargs):
self.real_initial_environ = copy.deepcopy(self.initial_environ)

self.easybuild_pkgs = ['easybuild-framework', 'easybuild-easyblocks', 'easybuild-easyconfigs']

# check whether 'easybuild' package is part of the sources
self.with_easybuild_pkg = False
for source in self.cfg['sources']:
if isinstance(source, dict):
pkg_name = source.get('filename')
if pkg_name is None:
raise EasyBuildError(f"Unknown filename for source: {source}")
elif isinstance(source, str):
pkg_name = source
else:
raise EasyBuildError(f"Unknown type of source specification: {source}")

if pkg_name == f'easybuild-{self.version}':
self.with_easybuild_pkg = True
break

if LooseVersion(self.version) >= LooseVersion('2.0') and LooseVersion(self.version) <= LooseVersion('3.999'):
# deliberately include vsc-install & vsc-base twice;
# first time to ensure the specified vsc-install/vsc-base package is available when framework gets installed
Expand All @@ -73,8 +90,7 @@ def __init__(self, *args, **kwargs):
self.easybuild_pkgs.extend(['vsc-base', 'vsc-install'])
# consider setuptools first, in case it is listed as a sources
self.easybuild_pkgs.insert(0, 'setuptools')
elif (LooseVersion(self.version) >= LooseVersion('5.0') and
any(f'easybuild-{self.version}' in source['filename'] for source in self.cfg['sources'])):
elif LooseVersion(self.version) >= LooseVersion('5.0') and self.with_easybuild_pkg:
# use easybuild-base for easybuild to avoid matching all easybuild-* directories during install
self.easybuild_pkgs.append('easybuild-base')

Expand Down Expand Up @@ -145,7 +161,7 @@ def install_step(self):

super().install_step()

if not any(f'easybuild-{self.version}' in source['filename'] for source in self.cfg['sources']):
if not self.with_easybuild_pkg:
egginfo = os.path.join(self.installdir, self.pylibdir, f'easybuild-{self.version}.egg-info')
write_file(egginfo, EGGINFO % (self.version, ''.join(self.cfg['description'].splitlines())))

Expand Down