'Read the contents of a file and parse them as a spec'

def read_spec(self, path):

    try:
        with open(path) as f:
            spec = spack.spec.Spec.from_yaml(f)
    except Exception as e:
        if spack.debug:
            raise
        raise SpecReadError(('Unable    to    read    file:    %s' % path), ('Cause:    ' + str(e)))
    spec._mark_concrete()
    return spec
