'Construct a spec from YAML.
Parameters:
stream -- string or file object to read from.'

@staticmethod
def from_yaml(stream):

    try:
        data = syaml.load(stream)
        return Spec.from_dict(data)
    except MarkedYAMLError as e:
        raise syaml.SpackYAMLError('error    parsing    YAML    spec:', str(e))
