Skip to content

Commit

Permalink
fix requirements + run_notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Aug 22, 2017
1 parent b424afc commit f8718c9
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 59 deletions.
18 changes: 2 additions & 16 deletions _unittests/ut_documentation/test_LONG_run_notebooks_nlp.py
Expand Up @@ -39,12 +39,11 @@
import src

from pyquickhelper.loghelper import fLOG, CustomLog
from pyquickhelper.pycode import get_temp_folder, add_missing_development_version
from pyquickhelper.pycode import get_temp_folder, add_missing_development_version, is_travis_orappveyor
from pyquickhelper.ipythonhelper import execute_notebook_list, execute_notebook_list_finalize_ut
from pyquickhelper.pycode import compare_module_version
from pyquickhelper.ipythonhelper import install_python_kernel_for_unittest
import src.mlstatpy
import IPython


class TestLONGRunNotebooksNLP(unittest.TestCase):
Expand All @@ -59,15 +58,7 @@ def test_long_run_notebook(self):
self._testMethodName,
OutputPrint=__name__ == "__main__")

if sys.version_info[0] == 2:
# notebooks are not converted into python 2.7, so not tested
return

if compare_module_version(IPython.__version__, "4.0.0") < 0:
# IPython is not recnt enough
return

kernel_name = None if "travis" in sys.executable else install_python_kernel_for_unittest(
kernel_name = None if is_travis_orappveyor() else install_python_kernel_for_unittest(
"python3_module_template")

temp = get_temp_folder(__file__, "temp_run_notebooks_nlp")
Expand All @@ -79,7 +70,6 @@ def test_long_run_notebook(self):
for f in os.listdir(fnb):
if os.path.splitext(f)[-1] == ".ipynb" and "_long" in f:
keepnote.append(os.path.join(fnb, f))
assert len(keepnote) > 0

# function to tell that a can be run
def valid(cell):
Expand All @@ -102,10 +92,6 @@ def valid(cell):
os.path.abspath(os.path.dirname(__file__)), "..", "..", "..", "jyquickhelper", "src"))
]

# creation of a kernel
kernel_name = None if "travis" in sys.executable else install_python_kernel_for_unittest(
"mlstatpy")

# run the notebooks
clog = CustomLog(temp)
clog("START")
Expand Down
12 changes: 0 additions & 12 deletions _unittests/ut_documentation/test_run_notebooks_dsgarden.py
Expand Up @@ -72,14 +72,6 @@ def test_run_notebook(self):
self._testMethodName,
OutputPrint=__name__ == "__main__")

if sys.version_info[0] == 2:
# notebooks are not converted into python 2.7, so not tested
return

if compare_module_version(IPython.__version__, "4.0.0") < 0:
# IPython is not recnt enough
return

kernel_name = None if "travis" in sys.executable else install_python_kernel_for_unittest(
"python3_module_template")

Expand Down Expand Up @@ -115,10 +107,6 @@ def valid(cell):
os.path.abspath(os.path.dirname(__file__)), "..", "..", "..", "jyquickhelper", "src"))
]

# creation of a kernel
kernel_name = None if "travis" in sys.executable else install_python_kernel_for_unittest(
"mlstatpy")

# run the notebooks
res = execute_notebook_list(
temp, keepnote, fLOG=fLOG, valid=valid, additional_path=addpaths, kernel_name=kernel_name)
Expand Down
18 changes: 2 additions & 16 deletions _unittests/ut_documentation/test_run_notebooks_ml.py
Expand Up @@ -39,12 +39,11 @@
import src

from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder
from pyquickhelper.pycode import get_temp_folder, is_travis_orappveyor
from pyquickhelper.ipythonhelper import execute_notebook_list, execute_notebook_list_finalize_ut
from pyquickhelper.pycode import compare_module_version
from pyquickhelper.ipythonhelper import install_python_kernel_for_unittest
import src.mlstatpy
import IPython


class TestRunNotebooksML(unittest.TestCase):
Expand All @@ -55,15 +54,7 @@ def test_run_notebook_ml(self):
self._testMethodName,
OutputPrint=__name__ == "__main__")

if sys.version_info[0] == 2:
# notebooks are not converted into python 2.7, so not tested
return

if compare_module_version(IPython.__version__, "4.0.0") < 0:
# IPython is not recnt enough
return

kernel_name = None if "travis" in sys.executable else install_python_kernel_for_unittest(
kernel_name = None if is_travis_orappveyor() else install_python_kernel_for_unittest(
"python3_module_template")

temp = get_temp_folder(__file__, "temp_run_notebooks_ml")
Expand All @@ -75,7 +66,6 @@ def test_run_notebook_ml(self):
for f in os.listdir(fnb):
if os.path.splitext(f)[-1] == ".ipynb" and "_long" not in f:
keepnote.append(os.path.join(fnb, f))
assert len(keepnote) > 0

# function to tell that a can be run
def valid(cell):
Expand All @@ -96,10 +86,6 @@ def valid(cell):
os.path.abspath(os.path.dirname(__file__)), "..", "..", "..", "jyquickhelper", "src"))
]

# creation of a kernel
kernel_name = None if "travis" in sys.executable else install_python_kernel_for_unittest(
"mlstatpy")

# run the notebooks
res = execute_notebook_list(
temp, keepnote, fLOG=fLOG, valid=valid, additional_path=addpaths, kernel_name=kernel_name)
Expand Down
16 changes: 1 addition & 15 deletions _unittests/ut_documentation/test_run_notebooks_nlp.py
Expand Up @@ -44,7 +44,6 @@
from pyquickhelper.pycode import compare_module_version
from pyquickhelper.ipythonhelper import install_python_kernel_for_unittest
import src.mlstatpy
import IPython


class TestRunNotebooksNLP(unittest.TestCase):
Expand All @@ -55,15 +54,7 @@ def test_run_notebook(self):
self._testMethodName,
OutputPrint=__name__ == "__main__")

if sys.version_info[0] == 2:
# notebooks are not converted into python 2.7, so not tested
return

if compare_module_version(IPython.__version__, "4.0.0") < 0:
# IPython is not recnt enough
return

kernel_name = None if "travis" in sys.executable else install_python_kernel_for_unittest(
kernel_name = None if is_travis_orappveyor() else install_python_kernel_for_unittest(
"python3_module_template")

temp = get_temp_folder(__file__, "temp_run_notebooks_nlp")
Expand All @@ -75,7 +66,6 @@ def test_run_notebook(self):
for f in os.listdir(fnb):
if os.path.splitext(f)[-1] == ".ipynb" and "long" not in f:
keepnote.append(os.path.join(fnb, f))
assert len(keepnote) > 0

# function to tell that a can be run
def valid(cell):
Expand All @@ -98,10 +88,6 @@ def valid(cell):
os.path.abspath(os.path.dirname(__file__)), "..", "..", "..", "pyquickhelper", "src"))
]

# creation of a kernel
kernel_name = None if "travis" in sys.executable else install_python_kernel_for_unittest(
"mlstatpy")

# run the notebooks
res = execute_notebook_list(
temp, keepnote, fLOG=fLOG, valid=valid, additional_path=addpaths, kernel_name=kernel_name)
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Expand Up @@ -5,6 +5,7 @@ blockdiag
bokeh
coverage
jyquickhelper
mako
mutagen
pycodestyle>=2.0.0
pydocstyle
Expand Down

0 comments on commit f8718c9

Please sign in to comment.