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 experimental support for YAML-based easyconfig format (.yeb) #4237

Merged
merged 7 commits into from
Apr 12, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 1 addition & 5 deletions easybuild/framework/easyconfig/easyconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
from easybuild.framework.easyconfig.format.convert import Dependency
from easybuild.framework.easyconfig.format.format import DEPENDENCY_PARAMETERS
from easybuild.framework.easyconfig.format.one import EB_FORMAT_EXTENSION, retrieve_blocks_in_spec
from easybuild.framework.easyconfig.format.yeb import YEB_FORMAT_EXTENSION, is_yeb_format
from easybuild.framework.easyconfig.licenses import EASYCONFIG_LICENSES_DICT
from easybuild.framework.easyconfig.parser import DEPRECATED_PARAMETERS, REPLACED_PARAMETERS
from easybuild.framework.easyconfig.parser import EasyConfigParser, fetch_parameters_from_easyconfig
Expand Down Expand Up @@ -571,10 +570,7 @@ def __str__(self):
def filename(self):
"""Determine correct filename for this easyconfig file."""

if is_yeb_format(self.path, self.rawtxt):
ext = YEB_FORMAT_EXTENSION
else:
ext = EB_FORMAT_EXTENSION
ext = EB_FORMAT_EXTENSION

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

Expand Down
169 changes: 0 additions & 169 deletions easybuild/framework/easyconfig/format/yeb.py

This file was deleted.

8 changes: 2 additions & 6 deletions easybuild/framework/easyconfig/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
from easybuild.base import fancylogger
from easybuild.framework.easyconfig.format.format import FORMAT_DEFAULT_VERSION
from easybuild.framework.easyconfig.format.format import get_format_version, get_format_version_classes
from easybuild.framework.easyconfig.format.yeb import FormatYeb, is_yeb_format
from easybuild.framework.easyconfig.types import PARAMETER_TYPES, check_type_of_param_value
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.filetools import read_file, write_file
Expand Down Expand Up @@ -189,11 +188,8 @@ def _get_format_version_class(self):
def _set_formatter(self, filename):
"""Obtain instance of the formatter"""
if self._formatter is None:
if is_yeb_format(filename, self.rawcontent):
self._formatter = FormatYeb()
else:
klass = self._get_format_version_class()
self._formatter = klass()
klass = self._get_format_version_class()
self._formatter = klass()
self._formatter.parse(self.rawcontent)

def set_format_text(self):
Expand Down
11 changes: 2 additions & 9 deletions easybuild/framework/easyconfig/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
from easybuild.framework.easyconfig.easyconfig import EASYCONFIGS_ARCHIVE_DIR, ActiveMNS, EasyConfig
from easybuild.framework.easyconfig.easyconfig import create_paths, det_file_info, get_easyblock_class
from easybuild.framework.easyconfig.easyconfig import process_easyconfig
from easybuild.framework.easyconfig.format.yeb import quote_yaml_special_chars
from easybuild.framework.easyconfig.style import cmdline_easyconfigs_style_check
from easybuild.tools import LooseVersion
from easybuild.tools.build_log import EasyBuildError, print_msg, print_warning
Expand Down Expand Up @@ -412,7 +411,7 @@ def parse_easyconfigs(paths, validate=True):
return easyconfigs, generated_ecs


def stats_to_str(stats, isyeb=False):
def stats_to_str(stats):
"""
Pretty print build statistics to string.
"""
Expand All @@ -422,13 +421,7 @@ def stats_to_str(stats, isyeb=False):
txt = "{\n"
pref = " "
for key in sorted(stats):
if isyeb:
val = stats[key]
if isinstance(val, tuple):
val = list(val)
key, val = quote_yaml_special_chars(key), quote_yaml_special_chars(val)
else:
key, val = quote_str(key), quote_str(stats[key])
key, val = quote_str(key), quote_str(stats[key])
txt += "%s%s: %s,\n" % (pref, key, val)
txt += "}"
return txt
Expand Down
5 changes: 2 additions & 3 deletions easybuild/tools/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
from easybuild.framework.easyconfig.easyconfig import HAVE_AUTOPEP8
from easybuild.framework.easyconfig.format.one import EB_FORMAT_EXTENSION
from easybuild.framework.easyconfig.format.pyheaderconfigobj import build_easyconfig_constants_dict
from easybuild.framework.easyconfig.format.yeb import YEB_FORMAT_EXTENSION
from easybuild.framework.easyconfig.tools import alt_easyconfig_paths, get_paths_for
from easybuild.toolchains.compiler.systemcompiler import TC_CONSTANT_SYSTEM
from easybuild.tools import LooseVersion, build_log, run # build_log should always stay there, to ensure EasyBuildLog
Expand Down Expand Up @@ -1160,11 +1159,11 @@ def _postprocess_config(self):
# which makes it susceptible to 'eating' the following argument/option;
# for example: with 'eb -r foo', 'foo' must be an existing directory (or 'eb foo -r' should be used);
# when multiple directories are specified, we deliberately do not enforce that all of them exist;
# if a single argument is passed to --robot/-r that ends with '.eb' or '.yeb', we assume it's an easyconfig
# if a single argument is passed to --robot/-r that ends with '.eb' we assume it's an easyconfig
if len(self.options.robot) == 1:
robot_arg = self.options.robot[0]
if not os.path.isdir(robot_arg):
if robot_arg.endswith(EB_FORMAT_EXTENSION) or robot_arg.endswith(YEB_FORMAT_EXTENSION):
if robot_arg.endswith(EB_FORMAT_EXTENSION):
info_msg = "Sole --robot argument %s is not an existing directory, "
info_msg += "promoting it to a stand-alone argument since it looks like an easyconfig file name"
self.log.info(info_msg, robot_arg)
Expand Down
15 changes: 4 additions & 11 deletions easybuild/tools/repository/filerepo.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@

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

yeb_format = is_yeb_format(cfg, None)
if yeb_format:
extension = YEB_FORMAT_EXTENSION
prefix = "buildstats: ["

else:
extension = EB_FORMAT_EXTENSION
prefix = "buildstats = ["
extension = EB_FORMAT_EXTENSION
prefix = "buildstats = ["

# destination
dest = os.path.join(full_path, "%s-%s%s" % (name, version, extension))
Expand All @@ -109,10 +102,10 @@ def add_easyconfig(self, cfg, name, version, stats, previous):
if previous:
statstxt = statscomment + statsprefix + '\n'
for entry in previous + [stats]:
statstxt += stats_to_str(entry, isyeb=yeb_format) + ',\n'
statstxt += stats_to_str(entry) + ',\n'
statstxt += statssuffix
else:
statstxt = statscomment + statsprefix + stats_to_str(stats, isyeb=yeb_format) + statssuffix
statstxt = statscomment + statsprefix + stats_to_str(stats) + statssuffix

txt += statstxt
write_file(dest, txt)
Expand Down
2 changes: 1 addition & 1 deletion easybuild/tools/systemtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
'python-hglib': ('hglib', "using Mercurial repository as easyconfigs archive"),
'requests': (None, "fallback library for downloading files"),
'Rich': (None, "eb command rich terminal output"),
'PyYAML': ('yaml', "easystack files and .yeb easyconfig format"),
'PyYAML': ('yaml', "easystack files easyconfig format"),
'setuptools': ('pkg_resources', "obtaining information on Python packages via pkg_resources module"),
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ dependencies = [
# it's nice to have an up to date openssl for security reasons
]

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

# order is important!
# package versions updated May 28th 2015
Expand Down
18 changes: 0 additions & 18 deletions test/framework/easyconfigs/yeb/CrayCCE-5.1.29.yeb

This file was deleted.