def ensure_sphinx_astropy_installed():
    """
    Make sure that sphinx-astropy is available.

    This returns the available version of sphinx-astropy as well as any
    paths that should be added to sys.path for sphinx-astropy to be available.
    """
    sys_path_inserts = []
    sphinx_astropy_version = None
    try:
        from sphinx_astropy import __version__ as sphinx_astropy_version
    except ImportError:
        raise ImportError(
            'sphinx-astropy needs to be installed to buildthe documentation.')
    return sphinx_astropy_version, sys_path_inserts
