Remove deprecated config options (#44061)

These options have been deprecated in v0.21, and
slated for removal in v0.23
This commit is contained in:
Massimiliano Culpo 2024-09-06 23:14:36 +02:00 committed by GitHub
parent afc9615abf
commit a3fa54812f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 0 additions and 65 deletions

View File

@ -257,40 +257,6 @@ def _search_duplicate_specs_in_externals(error_cls):
return errors return errors
@config_packages
def _deprecated_preferences(error_cls):
"""Search package preferences deprecated in v0.21 (and slated for removal in v0.23)"""
# TODO (v0.23): remove this audit as the attributes will not be allowed in config
errors = []
packages_yaml = spack.config.CONFIG.get_config("packages")
def make_error(attribute_name, config_data, summary):
s = io.StringIO()
s.write("Occurring in the following file:\n")
dict_view = syaml.syaml_dict((k, v) for k, v in config_data.items() if k == attribute_name)
syaml.dump_config(dict_view, stream=s, blame=True)
return error_cls(summary=summary, details=[s.getvalue()])
if "all" in packages_yaml and "version" in packages_yaml["all"]:
summary = "Using the deprecated 'version' attribute under 'packages:all'"
errors.append(make_error("version", packages_yaml["all"], summary))
for package_name in packages_yaml:
if package_name == "all":
continue
package_conf = packages_yaml[package_name]
for attribute in ("compiler", "providers", "target"):
if attribute not in package_conf:
continue
summary = (
f"Using the deprecated '{attribute}' attribute " f"under 'packages:{package_name}'"
)
errors.append(make_error(attribute, package_conf, summary))
return errors
@config_packages @config_packages
def _avoid_mismatched_variants(error_cls): def _avoid_mismatched_variants(error_cls):
"""Warns if variant preferences have mismatched types or names.""" """Warns if variant preferences have mismatched types or names."""

View File

@ -109,7 +109,6 @@
"require": requirements, "require": requirements,
"prefer": prefer_and_conflict, "prefer": prefer_and_conflict,
"conflict": prefer_and_conflict, "conflict": prefer_and_conflict,
"version": {}, # Here only to warn users on ignored properties
"target": { "target": {
"type": "array", "type": "array",
"default": [], "default": [],
@ -140,16 +139,6 @@
}, },
"variants": variants, "variants": variants,
}, },
"deprecatedProperties": [
{
"names": ["version"],
"message": "setting version preferences in the 'all' section of "
"packages.yaml is deprecated and will be removed in v0.23"
"\n\n\tThese preferences will be ignored by Spack. You can "
"set them only in package-specific sections of the same file.\n",
"error": False,
}
],
} }
}, },
"patternProperties": { "patternProperties": {
@ -167,14 +156,11 @@
# version strings # version strings
"items": {"anyOf": [{"type": "string"}, {"type": "number"}]}, "items": {"anyOf": [{"type": "string"}, {"type": "number"}]},
}, },
"target": {}, # Here only to warn users on ignored properties
"compiler": {}, # Here only to warn users on ignored properties
"buildable": {"type": "boolean", "default": True}, "buildable": {"type": "boolean", "default": True},
"permissions": permissions, "permissions": permissions,
# If 'get_full_repo' is promoted to a Package-level # If 'get_full_repo' is promoted to a Package-level
# attribute, it could be useful to set it here # attribute, it could be useful to set it here
"package_attributes": package_attributes, "package_attributes": package_attributes,
"providers": {}, # Here only to warn users on ignored properties
"variants": variants, "variants": variants,
"externals": { "externals": {
"type": "array", "type": "array",
@ -206,20 +192,6 @@
}, },
}, },
}, },
"deprecatedProperties": [
{
"names": ["target", "compiler", "providers"],
"message": "setting '{name}:' preferences in "
"a package-specific section of packages.yaml is deprecated, and will be "
"removed in v0.23.\n\n\tThis preferences will be ignored by Spack, and "
"can be set only in the 'all' section of the same file. "
"You can run:\n\n\t\t$ spack audit configs\n\n\tto get better "
"diagnostics, including files:lines where the deprecated "
"attributes are used.\n\n\tUse requirements to enforce conditions"
f" on specific packages: {REQUIREMENT_URL}\n",
"error": False,
}
],
} }
}, },
} }

View File

@ -4204,9 +4204,6 @@ def test_env_include_mixed_views(tmp_path, mutable_mock_env_path, mutable_config
{''.join(includes)} {''.join(includes)}
specs: specs:
- mpileaks - mpileaks
packages:
mpileaks:
compiler: [gcc]
""" """
) )