Skip to content

Commit 8bf67b5

Browse files
authored
Merge pull request #4237 from branfosj/yeb
remove experimental support for YAML-based easyconfig format (.yeb)
2 parents 7d39e27 + 55255b6 commit 8bf67b5

21 files changed

Lines changed: 15 additions & 810 deletions

easybuild/framework/easyconfig/easyconfig.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
from easybuild.framework.easyconfig.format.convert import Dependency
5757
from easybuild.framework.easyconfig.format.format import DEPENDENCY_PARAMETERS
5858
from easybuild.framework.easyconfig.format.one import EB_FORMAT_EXTENSION, retrieve_blocks_in_spec
59-
from easybuild.framework.easyconfig.format.yeb import YEB_FORMAT_EXTENSION, is_yeb_format
6059
from easybuild.framework.easyconfig.licenses import EASYCONFIG_LICENSES_DICT
6160
from easybuild.framework.easyconfig.parser import DEPRECATED_PARAMETERS, REPLACED_PARAMETERS
6261
from easybuild.framework.easyconfig.parser import EasyConfigParser, fetch_parameters_from_easyconfig
@@ -571,10 +570,7 @@ def __str__(self):
571570
def filename(self):
572571
"""Determine correct filename for this easyconfig file."""
573572

574-
if is_yeb_format(self.path, self.rawtxt):
575-
ext = YEB_FORMAT_EXTENSION
576-
else:
577-
ext = EB_FORMAT_EXTENSION
573+
ext = EB_FORMAT_EXTENSION
578574

579575
return '%s-%s%s' % (self.name, det_full_ec_version(self), ext)
580576

easybuild/framework/easyconfig/format/yeb.py

Lines changed: 0 additions & 169 deletions
This file was deleted.

easybuild/framework/easyconfig/parser.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
from easybuild.base import fancylogger
3838
from easybuild.framework.easyconfig.format.format import FORMAT_DEFAULT_VERSION
3939
from easybuild.framework.easyconfig.format.format import get_format_version, get_format_version_classes
40-
from easybuild.framework.easyconfig.format.yeb import FormatYeb, is_yeb_format
4140
from easybuild.framework.easyconfig.types import PARAMETER_TYPES, check_type_of_param_value
4241
from easybuild.tools.build_log import EasyBuildError
4342
from easybuild.tools.filetools import read_file, write_file
@@ -189,11 +188,8 @@ def _get_format_version_class(self):
189188
def _set_formatter(self, filename):
190189
"""Obtain instance of the formatter"""
191190
if self._formatter is None:
192-
if is_yeb_format(filename, self.rawcontent):
193-
self._formatter = FormatYeb()
194-
else:
195-
klass = self._get_format_version_class()
196-
self._formatter = klass()
191+
klass = self._get_format_version_class()
192+
self._formatter = klass()
197193
self._formatter.parse(self.rawcontent)
198194

199195
def set_format_text(self):

easybuild/framework/easyconfig/tools.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
from easybuild.framework.easyconfig.easyconfig import EASYCONFIGS_ARCHIVE_DIR, ActiveMNS, EasyConfig
5252
from easybuild.framework.easyconfig.easyconfig import create_paths, det_file_info, get_easyblock_class
5353
from easybuild.framework.easyconfig.easyconfig import process_easyconfig
54-
from easybuild.framework.easyconfig.format.yeb import quote_yaml_special_chars
5554
from easybuild.framework.easyconfig.style import cmdline_easyconfigs_style_check
5655
from easybuild.tools import LooseVersion
5756
from easybuild.tools.build_log import EasyBuildError, print_msg, print_warning
@@ -412,7 +411,7 @@ def parse_easyconfigs(paths, validate=True):
412411
return easyconfigs, generated_ecs
413412

414413

415-
def stats_to_str(stats, isyeb=False):
414+
def stats_to_str(stats):
416415
"""
417416
Pretty print build statistics to string.
418417
"""
@@ -422,13 +421,7 @@ def stats_to_str(stats, isyeb=False):
422421
txt = "{\n"
423422
pref = " "
424423
for key in sorted(stats):
425-
if isyeb:
426-
val = stats[key]
427-
if isinstance(val, tuple):
428-
val = list(val)
429-
key, val = quote_yaml_special_chars(key), quote_yaml_special_chars(val)
430-
else:
431-
key, val = quote_str(key), quote_str(stats[key])
424+
key, val = quote_str(key), quote_str(stats[key])
432425
txt += "%s%s: %s,\n" % (pref, key, val)
433426
txt += "}"
434427
return txt

easybuild/tools/options.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
from easybuild.framework.easyconfig.easyconfig import HAVE_AUTOPEP8
5656
from easybuild.framework.easyconfig.format.one import EB_FORMAT_EXTENSION
5757
from easybuild.framework.easyconfig.format.pyheaderconfigobj import build_easyconfig_constants_dict
58-
from easybuild.framework.easyconfig.format.yeb import YEB_FORMAT_EXTENSION
5958
from easybuild.framework.easyconfig.tools import alt_easyconfig_paths, get_paths_for
6059
from easybuild.toolchains.compiler.systemcompiler import TC_CONSTANT_SYSTEM
6160
from easybuild.tools import LooseVersion, build_log, run # build_log should always stay there, to ensure EasyBuildLog
@@ -1160,11 +1159,11 @@ def _postprocess_config(self):
11601159
# which makes it susceptible to 'eating' the following argument/option;
11611160
# for example: with 'eb -r foo', 'foo' must be an existing directory (or 'eb foo -r' should be used);
11621161
# when multiple directories are specified, we deliberately do not enforce that all of them exist;
1163-
# if a single argument is passed to --robot/-r that ends with '.eb' or '.yeb', we assume it's an easyconfig
1162+
# if a single argument is passed to --robot/-r that ends with '.eb' we assume it's an easyconfig
11641163
if len(self.options.robot) == 1:
11651164
robot_arg = self.options.robot[0]
11661165
if not os.path.isdir(robot_arg):
1167-
if robot_arg.endswith(EB_FORMAT_EXTENSION) or robot_arg.endswith(YEB_FORMAT_EXTENSION):
1166+
if robot_arg.endswith(EB_FORMAT_EXTENSION):
11681167
info_msg = "Sole --robot argument %s is not an existing directory, "
11691168
info_msg += "promoting it to a stand-alone argument since it looks like an easyconfig file name"
11701169
self.log.info(info_msg, robot_arg)

easybuild/tools/repository/filerepo.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343

4444
from easybuild.framework.easyconfig.easyconfig import EasyConfig
4545
from easybuild.framework.easyconfig.format.one import EB_FORMAT_EXTENSION
46-
from easybuild.framework.easyconfig.format.yeb import YEB_FORMAT_EXTENSION, is_yeb_format
4746
from easybuild.framework.easyconfig.tools import stats_to_str
4847
from easybuild.tools.filetools import copy_file, mkdir, read_file, write_file
4948
from easybuild.tools.repository.repository import Repository
@@ -85,14 +84,8 @@ def add_easyconfig(self, cfg, name, version, stats, previous):
8584
# create directory for eb file
8685
full_path = os.path.join(self.wc, self.subdir, name)
8786

88-
yeb_format = is_yeb_format(cfg, None)
89-
if yeb_format:
90-
extension = YEB_FORMAT_EXTENSION
91-
prefix = "buildstats: ["
92-
93-
else:
94-
extension = EB_FORMAT_EXTENSION
95-
prefix = "buildstats = ["
87+
extension = EB_FORMAT_EXTENSION
88+
prefix = "buildstats = ["
9689

9790
# destination
9891
dest = os.path.join(full_path, "%s-%s%s" % (name, version, extension))
@@ -109,10 +102,10 @@ def add_easyconfig(self, cfg, name, version, stats, previous):
109102
if previous:
110103
statstxt = statscomment + statsprefix + '\n'
111104
for entry in previous + [stats]:
112-
statstxt += stats_to_str(entry, isyeb=yeb_format) + ',\n'
105+
statstxt += stats_to_str(entry) + ',\n'
113106
statstxt += statssuffix
114107
else:
115-
statstxt = statscomment + statsprefix + stats_to_str(stats, isyeb=yeb_format) + statssuffix
108+
statstxt = statscomment + statsprefix + stats_to_str(stats) + statssuffix
116109

117110
txt += statstxt
118111
write_file(dest, txt)

easybuild/tools/systemtools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@
211211
'python-hglib': ('hglib', "using Mercurial repository as easyconfigs archive"),
212212
'requests': (None, "fallback library for downloading files"),
213213
'Rich': (None, "eb command rich terminal output"),
214-
'PyYAML': ('yaml', "easystack files and .yeb easyconfig format"),
214+
'PyYAML': ('yaml', "easystack files easyconfig format"),
215215
'setuptools': ('pkg_resources', "obtaining information on Python packages via pkg_resources module"),
216216
}
217217

test/framework/easyconfigs/test_ecs/p/Python/Python-2.7.10-intel-2018a.eb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ dependencies = [
2929
# it's nice to have an up to date openssl for security reasons
3030
]
3131

32-
# zlib is only included here for the sake of testing parsing of .yeb easyconfigs!
33-
osdependencies = ['zlib', ('openssl-devel', 'libssl-dev', 'libopenssl-devel')]
32+
osdependencies = [('openssl-devel', 'libssl-dev', 'libopenssl-devel')]
3433

3534
# order is important!
3635
# package versions updated May 28th 2015

test/framework/easyconfigs/yeb/CrayCCE-5.1.29.yeb

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)