File tree Expand file tree Collapse file tree 4 files changed +22
-2
lines changed
plotly/tests/test_core/test_jupyter Expand file tree Collapse file tree 4 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ machine:
7
7
PLOTLY_PYTHON_VERSIONS : 2.7.8 3.3.3 3.4.1
8
8
PLOTLY_CORE_REQUIREMENTS_FILE : ${PLOTLY_PACKAGE_ROOT}/requirements.txt
9
9
PLOTLY_OPTIONAL_REQUIREMENTS_FILE : ${PLOTLY_PACKAGE_ROOT}/optional-requirements.txt
10
+ PLOTLY_JUPYTER_TEST_DIR : ${PLOTLY_PACKAGE_ROOT}/plotly/tests/test_core/test_jupyter
11
+
12
+ node :
13
+ version : 4.2.1
10
14
11
15
dependencies :
12
16
@@ -22,6 +26,10 @@ dependencies:
22
26
# we need to cd out of the project root to ensure the install worked
23
27
- cd ~ && python -c "import plotly"
24
28
29
+ # install jupyter test JS requirements
30
+ - cd ${PLOTLY_JUPYTER_TEST_DIR} && npm i
31
+
32
+
25
33
cache_directories :
26
34
27
35
- " ~/.pyenv/versions" # attempt to just cache installed pyenv things
Original file line number Diff line number Diff line change @@ -39,4 +39,8 @@ for version in ${PLOTLY_PYTHON_VERSIONS[@]}; do
39
39
pip install -r ${PLOTLY_OPTIONAL_REQUIREMENTS_FILE} ||
40
40
error_exit " ${SIG} ${LINENO} : can't install optional for Python ${version} ."
41
41
42
+ # add python version to available jupyter kernel list
43
+ python -m ipykernel install --user --name ${version}
44
+ echo " ${SIG} jupyter kernelspec list"
45
+ jupyter kernelspec list
42
46
done
Original file line number Diff line number Diff line change 24
24
## scipy deps for some FigureFactory functions ##
25
25
scipy
26
26
27
+ ## jupyter ##
28
+ jupyter
29
+ ipykernel
Original file line number Diff line number Diff line change 7
7
from nbconvert .preprocessors import ExecutePreprocessor
8
8
9
9
from unittest import TestCase
10
- from os import path
10
+ from os import path , environ
11
11
import subprocess
12
12
13
13
PATH_ROOT = path .dirname (__file__ )
14
14
PATH_FIXTURES = path .join (PATH_ROOT , 'fixtures' )
15
15
PATH_TEST_NB = path .join (PATH_FIXTURES , 'test.ipynb' )
16
16
PATH_TEST_HTML = path .join (PATH_FIXTURES , 'test.html' )
17
+ PYENV_VERSION = environ ['PYENV_VERSION' ]
17
18
18
19
19
20
class PlotlyJupyterTestCase (TestCase ):
20
21
def setUp (self ):
21
22
with open (PATH_TEST_NB , 'r' ) as f :
22
23
self .nb = nbformat .read (f , as_version = 4 )
23
24
24
- self .ep = ExecutePreprocessor (timeout = 600 )
25
+ if PYENV_VERSION :
26
+ self .ep = ExecutePreprocessor (timeout = 600 , kernel_name = PYENV_VERSION )
27
+ else :
28
+ self .ep = ExecutePreprocessor (timeout = 600 )
29
+
25
30
self .html_exporter = HTMLExporter ()
26
31
27
32
self .ep .preprocess (self .nb , {'metadata' : {'path' : '.' }})
You can’t perform that action at this time.
0 commit comments