def preferred_variants(self, pkg_name):
    'Facts on concretization preferences, as read from packages.yaml'
    preferences = spack.package_prefs.PackagePrefs
    preferred_variants = preferences.preferred_variants(pkg_name)
    if (not preferred_variants):
        return
    for variant_name in sorted(preferred_variants):
        variant = preferred_variants[variant_name]
        values = variant.value
        if (not isinstance(values, tuple)):
            values = (values,)
        spec = spack.spec.Spec(pkg_name)
        spec.update_variant_validate(variant_name, values)
        for value in values:
            self.variant_values_from_specs.add((pkg_name, variant.name, value))
            self.gen.fact(fn.variant_default_value_from_packages_yaml(pkg_name, variant.name, value))
Facts on concretization preferences, as read from packages.yaml
def preferred_variants(self, pkg_name):
    
    preferences = spack.package_prefs.PackagePrefs
    preferred_variants = preferences.preferred_variants(pkg_name)
    if (not preferred_variants):
        return
    for variant_name in sorted(preferred_variants):
        variant = preferred_variants[variant_name]
        values = variant.value
        if (not isinstance(values, tuple)):
            values = (values,)
        spec = spack.spec.Spec(pkg_name)
        spec.update_variant_validate(variant_name, values)
        for value in values:
            self.variant_values_from_specs.add((pkg_name, variant.name, value))
            self.gen.fact(fn.variant_default_value_from_packages_yaml(pkg_name, variant.name, value))