Beispiel #1
0
requires_black = pytest.mark.skipif(not tool_version("black"),
                                    reason="black not found")
requires_isort = pytest.mark.skipif(
    not isort_version() or isort_version() <= "5.3.0",
    reason="isort not found",
)
requires_flake8 = pytest.mark.skipif(not tool_version("flake8"),
                                     reason="flake8 not found")
requires_autopep8 = pytest.mark.skipif(not tool_version("autopep8"),
                                       reason="autopep8 not found")
requires_nbconvert = pytest.mark.skipif(not tool_version("jupyter nbconvert"),
                                        reason="nbconvert not found")
requires_sphinx_gallery = pytest.mark.skipif(
    not rst2md, reason="sphinx_gallery is not available")
requires_pandoc = pytest.mark.skipif(
    not is_pandoc_available() or sys.version_info < (3, ),
    reason="pandoc>=2.7.2 is not available",
)
requires_no_pandoc = pytest.mark.skipif(is_pandoc_available(),
                                        reason="Pandoc is installed")
requires_ir_kernel = pytest.mark.skipif(
    not any(
        get_kernel_spec(name).language == "R" for name in find_kernel_specs()),
    reason="irkernel is not installed",
)
requires_myst = pytest.mark.skipif(not is_myst_available(),
                                   reason="myst_parser not found")
requires_no_myst = pytest.mark.skipif(is_myst_available(),
                                      reason="myst is available")
skip_on_windows = pytest.mark.skipif(sys.platform.startswith("win"),
                                     reason="Issue 489")
Beispiel #2
0

requires_jupytext_installed = pytest.mark.skipif(
    not tool_version("jupytext"), reason="jupytext is not installed")
requires_black = pytest.mark.skipif(not tool_version("black"),
                                    reason="black not found")
requires_flake8 = pytest.mark.skipif(not tool_version("flake8"),
                                     reason="flake8 not found")
requires_autopep8 = pytest.mark.skipif(not tool_version("autopep8"),
                                       reason="autopep8 not found")
requires_nbconvert = pytest.mark.skipif(not tool_version("jupyter nbconvert"),
                                        reason="nbconvert not found")
requires_sphinx_gallery = pytest.mark.skipif(
    not rst2md, reason="sphinx_gallery is not available")
requires_pandoc = pytest.mark.skipif(
    not is_pandoc_available() or sys.version_info < (3, ),
    reason="pandoc>=2.7.2 is not available",
)
requires_ir_kernel = pytest.mark.skipif(kernelspec_from_language("R") is None,
                                        reason="irkernel is not installed")
requires_myst = pytest.mark.skipif(not is_myst_available(),
                                   reason="myst_parser not found")


def list_notebooks(path="ipynb", skip="World"):
    """All notebooks in the directory notebooks/path,
    or in the package itself"""
    if path == "ipynb":
        return (list_notebooks("ipynb_julia", skip=skip) +
                list_notebooks("ipynb_py", skip=skip) +
                list_notebooks("ipynb_R", skip=skip))
Beispiel #3
0
    reason="unordered dict result in changes in chunk options")


def tool_version(tool):
    try:
        return system(tool, '--version')
    except (OSError, SystemExit):  # pragma: no cover
        return None


requires_jupytext_installed = pytest.mark.skipif(not tool_version('jupytext'), reason='jupytext is not installed')
requires_black = pytest.mark.skipif(not tool_version('black'), reason='black not found')
requires_flake8 = pytest.mark.skipif(not tool_version('flake8'), reason='flake8 not found')
requires_autopep8 = pytest.mark.skipif(not tool_version('autopep8'), reason='autopep8 not found')
requires_sphinx_gallery = pytest.mark.skipif(not rst2md, reason='sphinx_gallery is not available')
requires_pandoc = pytest.mark.skipif(not is_pandoc_available(), reason='pandoc>=2.7.2 is not available')


def list_notebooks(path='ipynb', skip='World'):
    """All notebooks in the directory notebooks/path,
    or in the package itself"""
    if path == 'ipynb':
        return list_notebooks('ipynb_julia', skip=skip) + \
               list_notebooks('ipynb_py', skip=skip) + \
               list_notebooks('ipynb_R', skip=skip)

    nb_path = os.path.dirname(os.path.abspath(__file__))
    if path.startswith('.'):
        nb_path = os.path.join(nb_path, path)
    else:
        nb_path = os.path.join(nb_path, 'notebooks', path)
Beispiel #4
0
        return None


requires_jupytext_installed = pytest.mark.skipif(
    not tool_version('jupytext'), reason='jupytext is not installed')
requires_black = pytest.mark.skipif(not tool_version('black'),
                                    reason='black not found')
requires_flake8 = pytest.mark.skipif(not tool_version('flake8'),
                                     reason='flake8 not found')
requires_autopep8 = pytest.mark.skipif(not tool_version('autopep8'),
                                       reason='autopep8 not found')
requires_nbconvert = pytest.mark.skipif(not tool_version('jupyter nbconvert'),
                                        reason='nbconvert not found')
requires_sphinx_gallery = pytest.mark.skipif(
    not rst2md, reason='sphinx_gallery is not available')
requires_pandoc = pytest.mark.skipif(not is_pandoc_available(),
                                     reason='pandoc>=2.7.2 is not available')
requires_ir_kernel = pytest.mark.skipif(kernelspec_from_language('R') is None,
                                        reason='irkernel is not installed')
requires_myst = pytest.mark.skipif(not is_myst_available(),
                                   reason='myst_parser not founnd')


def list_notebooks(path='ipynb', skip='World'):
    """All notebooks in the directory notebooks/path,
    or in the package itself"""
    if path == 'ipynb':
        return list_notebooks('ipynb_julia', skip=skip) + \
               list_notebooks('ipynb_py', skip=skip) + \
               list_notebooks('ipynb_R', skip=skip)
Beispiel #5
0
    reason="isort not found",
)
requires_flake8 = pytest.mark.skipif(
    not tool_version("flake8"), reason="flake8 not found"
)
requires_autopep8 = pytest.mark.skipif(
    not tool_version("autopep8"), reason="autopep8 not found"
)
requires_nbconvert = pytest.mark.skipif(
    not tool_version("jupyter nbconvert"), reason="nbconvert not found"
)
requires_sphinx_gallery = pytest.mark.skipif(
    not rst2md, reason="sphinx_gallery is not available"
)
requires_pandoc = pytest.mark.skipif(
    not is_pandoc_available() or sys.version_info < (3,),
    reason="pandoc>=2.7.2 is not available",
)
requires_no_pandoc = pytest.mark.skipif(
    is_pandoc_available(), reason="Pandoc is installed"
)
requires_ir_kernel = pytest.mark.skipif(
    not any(get_kernel_spec(name).language == "R" for name in find_kernel_specs()),
    reason="irkernel is not installed",
)
requires_myst = pytest.mark.skipif(
    not is_myst_available(), reason="myst_parser not found"
)
requires_no_myst = pytest.mark.skipif(is_myst_available(), reason="myst is available")
requires_pre_commit = pytest.mark.skipif(
    not tool_version("pre-commit"), reason="pre-commit not found"