def assert_path(dist, attr, value):
    """Assert attribute describes a valid path.

       Various keyword variables, in calls to ``setuptools.setup``, allow the specification
       of paths where other qmesh packages should look for resources, such as third-party
       packages. This function asserts the value of such keywords is a string describing a
       valid path.

       Args:
           dist (setuptools.Distribution): The ``Distribution`` instance of ``setuptools``,
               orchestrating the installation or packaging procedure.
           attr (str): The name of the attribute, specified as a keyword argument in
               ``setuptools.setup`` calls.
           value (str): The value of the attribute (keyword), which should be a gmsh path.
       Raises:
           DistutilsSetupError: If the keyword value is not a valid path.
    """
    from os import path
    from setuptools import distutils
    if not path.exists(value):
        msg = '%r must be a path (%r is not a path)' % (attr, value)
        dist.announce(msg, distutils.log.FATAL)
        raise distutils.errors.DistutilsSetupError(msg)
