temporarily undo everything in this PR to check if it could somehow be causing a failure in an unrelated test

This commit is contained in:
Peter Josef Scheibel
2022-10-20 09:54:42 -06:00
committed by Gregory Becker
parent 114ad6dd0a
commit edc3a3d19b
2 changed files with 1 additions and 31 deletions

View File

@@ -1362,21 +1362,7 @@ def get_pkg_class(self, pkg_name):
if not inspect.isclass(cls):
tty.die("%s.%s is not a class" % (pkg_name, class_name))
new_cfg_settings = (
spack.config.get("packages").get(pkg_name, {}).get("package_attributes", {})
)
overidden_attrs = getattr(cls, "overidden_attrs", {})
for key, val in overidden_attrs.items():
setattr(cls, key, val)
# Keep track of every class attribute that is overidden by the config:
# if the config changes between calls to this method, we make sure to
# restore the original config values (in case the new config no longer
# sets attributes that it used to)
new_overidden_attrs = {}
for key, val in new_cfg_settings.items():
new_overidden_attrs[key] = getattr(cls, key)
setattr(cls, key, val)
setattr(cls, "overidden_attrs", dict(new_overidden_attrs))
# TODO: restore logic here
return cls

View File

@@ -179,22 +179,6 @@ def test_preferred_providers(self):
spec = concretize("mpileaks")
assert "zmpi" in spec
def test_config_set_url_for_package(self, mutable_mock_repo):
"""Test preferred providers of virtual packages are
applied correctly
"""
update_packages(
"mpileaks",
"package_attributes",
{"url": "http://www.somewhereelse.com/mpileaks-1.0.tar.gz"},
)
spec = concretize("mpileaks")
assert spec.package.fetcher[0].url == "http://www.somewhereelse.com/mpileaks-2.3.tar.gz"
update_packages("mpileaks", "package_attributes", {})
spec = concretize("mpileaks")
assert spec.package.fetcher[0].url == "http://www.llnl.gov/mpileaks-2.3.tar.gz"
def test_preferred(self):
""" "Test packages with some version marked as preferred=True"""
spec = Spec("python")