diff --git a/lib/spack/spack/repo.py b/lib/spack/spack/repo.py index 78e60457e36..1d2eb4a083a 100644 --- a/lib/spack/spack/repo.py +++ b/lib/spack/spack/repo.py @@ -1374,20 +1374,10 @@ def get_pkg_class(self, pkg_name): # sets attributes that it used to) new_overidden_attrs = {} for key, val in new_cfg_settings.items(): - if hasattr(cls, key): - new_overidden_attrs[key] = getattr(cls, key) - if isinstance(val, dict): - t = val.get("type", "string") - v = val["value"] - if t == "int": - v = int(v) - elif t == "float": - v = float(v) - elif t == "boolean": - v = yaml.load(v) - setattr(cls, key, v) - else: - setattr(cls, key, val) + if key not in ["git", "url", "submodules"]: + # Infer type + val = yaml.load(val) + setattr(cls, key, val) if new_overidden_attrs: setattr(cls, "overidden_attrs", dict(new_overidden_attrs)) elif hasattr(cls, "overidden_attrs"): diff --git a/lib/spack/spack/schema/packages.py b/lib/spack/spack/schema/packages.py index d6431ad18fc..57a20e6ee57 100644 --- a/lib/spack/spack/schema/packages.py +++ b/lib/spack/spack/schema/packages.py @@ -100,17 +100,7 @@ }, "patternProperties": { r"\w[\w-]*": { - "type": "object", - "additionalProperties": False, - "properties": { - "value": { - "type": "string", - }, - "type": { - "type": "string", - "enum": ["int", "float", "boolean"], - }, - }, + "type": "string", }, }, }, diff --git a/lib/spack/spack/test/concretize_preferences.py b/lib/spack/spack/test/concretize_preferences.py index 04057bfac4a..a80cb1a8590 100644 --- a/lib/spack/spack/test/concretize_preferences.py +++ b/lib/spack/spack/test/concretize_preferences.py @@ -202,16 +202,7 @@ def test_config_set_package_property(self, mutable_mock_repo): update_packages( "mpileaks", "package_attributes", - { - "x": { - "value": "1", - "type": "int", - }, - "y": { - "value": "true", - "type": "boolean", - }, - }, + {"x": "1", "y": "true"}, ) spec = concretize("mpileaks") assert spec.package.x == 1