From cfe7de4e9e380cd4c2dc54c6ed5181361af68539 Mon Sep 17 00:00:00 2001 From: "Joseph C. Slater" Date: Sat, 29 Aug 2015 09:16:24 -0400 Subject: [PATCH 01/11] IPython.nbformat is now nbformat in Jupyter I've changed the imports (two) in publish.py from IPython.nbformat to nbformat. I'm concerned that this breaks backwards compatibility though. I'm not sure how to assure that if nbformat doesn't exist, Python.nbformat will be. --- pymatbridge/publish.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pymatbridge/publish.py b/pymatbridge/publish.py index f6d97d7..9342e4d 100644 --- a/pymatbridge/publish.py +++ b/pymatbridge/publish.py @@ -1,5 +1,5 @@ -import IPython.nbformat.v4 as nbformat -from IPython.nbformat import write as nbwrite +import nbformat.v4 as nbformat +from nbformat import write as nbwrite import numpy as np From 58f12f0254bb3845d3690771ba442b714fb168e7 Mon Sep 17 00:00:00 2001 From: "Joseph C. Slater" Date: Sat, 29 Aug 2015 09:31:07 -0400 Subject: [PATCH 02/11] IPython.nbformat deprecated if nbformat exists as a package, import it instead of the legacy named Python.nbformat . Corrects error thrown by Jupyter. --- pymatbridge/publish.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pymatbridge/publish.py b/pymatbridge/publish.py index 9342e4d..90b0f88 100644 --- a/pymatbridge/publish.py +++ b/pymatbridge/publish.py @@ -1,5 +1,10 @@ -import nbformat.v4 as nbformat -from nbformat import write as nbwrite +try: + import nbformat.v4 as nbformat + from nbformat import write as nbwrite +except: + import IPython.nbformat.v4 as nbformat + from IPython.nbformat import write as nbwrite + import numpy as np From 38a4439297f302ca6f658dc7a5354f94b470665b Mon Sep 17 00:00:00 2001 From: "Joseph C. Slater" Date: Sat, 29 Aug 2015 11:06:02 -0400 Subject: [PATCH 03/11] Update publish.py --- pymatbridge/publish.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymatbridge/publish.py b/pymatbridge/publish.py index 90b0f88..213d3cb 100644 --- a/pymatbridge/publish.py +++ b/pymatbridge/publish.py @@ -1,7 +1,7 @@ try: import nbformat.v4 as nbformat from nbformat import write as nbwrite -except: +except ImportError: import IPython.nbformat.v4 as nbformat from IPython.nbformat import write as nbwrite From 03e9fd2733e0f7649b0d29ed5d66f1d69c67cc98 Mon Sep 17 00:00:00 2001 From: "Joseph C. Slater" Date: Sat, 29 Aug 2015 15:55:44 -0400 Subject: [PATCH 04/11] Update .travis.yml to include nbformat. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f9c5944..8ac9159 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ before_install: - conda config --set always_yes yes - conda update conda - conda info -a - - travis_retry conda create -n test $CONDA IPython pip nose pyzmq jsonschema + - travis_retry conda create -n test $CONDA IPython pip nose pyzmq jsonschema nbformat - source activate test - travis_retry pip install coveralls From e7a687e4c10efe527d607154dccbad73bc41dc40 Mon Sep 17 00:00:00 2001 From: "Joseph C. Slater" Date: Sat, 29 Aug 2015 16:06:25 -0400 Subject: [PATCH 05/11] Update .travis.yml- CONDA_Jupyter env added. modify the python3.4 env variable so nbformat isn't added for older versions of python. I'm guessing at this point. --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8ac9159..2e9394e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ deploy: env: - CONDA="python=2.7 numpy=1.7" - CONDA="python=3.3 numpy" - - CONDA="python=3.4 numpy" + - CONDA_Jupyter="python=3.4 numpy" before_install: - sudo apt-add-repository -y ppa:octave/stable; - sudo apt-get update; @@ -24,7 +24,8 @@ before_install: - conda config --set always_yes yes - conda update conda - conda info -a - - travis_retry conda create -n test $CONDA IPython pip nose pyzmq jsonschema nbformat + - travis_retry conda create -n test $CONDA IPython pip nose pyzmq jsonschema + - travis_retry conda create -n test $CONDA_Jupyter IPython pip nose pyzmq jsonschema nbformat - source activate test - travis_retry pip install coveralls From d98c05cabe9e79d66fa9dd5993e4914a38482229 Mon Sep 17 00:00:00 2001 From: "Joseph C. Slater" Date: Sat, 29 Aug 2015 16:11:24 -0400 Subject: [PATCH 06/11] Undid commit of changes to .travid.yml file. I have no idea how to fix this so travis can build it. My other changes seem to work, just not in travis. --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2e9394e..8ac9159 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ deploy: env: - CONDA="python=2.7 numpy=1.7" - CONDA="python=3.3 numpy" - - CONDA_Jupyter="python=3.4 numpy" + - CONDA="python=3.4 numpy" before_install: - sudo apt-add-repository -y ppa:octave/stable; - sudo apt-get update; @@ -24,8 +24,7 @@ before_install: - conda config --set always_yes yes - conda update conda - conda info -a - - travis_retry conda create -n test $CONDA IPython pip nose pyzmq jsonschema - - travis_retry conda create -n test $CONDA_Jupyter IPython pip nose pyzmq jsonschema nbformat + - travis_retry conda create -n test $CONDA IPython pip nose pyzmq jsonschema nbformat - source activate test - travis_retry pip install coveralls From 5c2a4720b64c0ba7ec94b0fc0ec45389ee47757e Mon Sep 17 00:00:00 2001 From: arokem Date: Mon, 21 Sep 2015 12:08:44 -0700 Subject: [PATCH 07/11] Try pip installing nbformat, until it comes in as a conda package for 3.3 --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8ac9159..e38ecca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,8 @@ before_install: - conda config --set always_yes yes - conda update conda - conda info -a - - travis_retry conda create -n test $CONDA IPython pip nose pyzmq jsonschema nbformat + - travis_retry conda create -n test $CONDA IPython pip nose pyzmq jsonschema + - pip install nbformat - source activate test - travis_retry pip install coveralls From 09ab6e509d06730baefddc931fc4dd8826ea05df Mon Sep 17 00:00:00 2001 From: arokem Date: Mon, 21 Sep 2015 12:17:27 -0700 Subject: [PATCH 08/11] travis_retry ? --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e38ecca..60ead21 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,7 +25,7 @@ before_install: - conda update conda - conda info -a - travis_retry conda create -n test $CONDA IPython pip nose pyzmq jsonschema - - pip install nbformat + - travis_retry pip install nbformat - source activate test - travis_retry pip install coveralls From 562f2693090452756733f16820a66285967438f3 Mon Sep 17 00:00:00 2001 From: arokem Date: Mon, 21 Sep 2015 12:28:57 -0700 Subject: [PATCH 09/11] Install nbformat in different ways, depending on python version. Sigh. --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 60ead21..dab3ec8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,7 +25,10 @@ before_install: - conda update conda - conda info -a - travis_retry conda create -n test $CONDA IPython pip nose pyzmq jsonschema - - travis_retry pip install nbformat + - if [[ $CONDA == python=3.3* ]]; then + pip install nbformat; + else + travis_retry conda install nbformat; - source activate test - travis_retry pip install coveralls From e4b2b9dcd3b9ef1b118ba2e2cfeb439fb00b96e4 Mon Sep 17 00:00:00 2001 From: arokem Date: Mon, 21 Sep 2015 12:36:06 -0700 Subject: [PATCH 10/11] Ugh bash. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index dab3ec8..4bc7373 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,6 +29,7 @@ before_install: pip install nbformat; else travis_retry conda install nbformat; + fi - source activate test - travis_retry pip install coveralls From fca113ab645ad8f4b265250c42509b73ccf69eda Mon Sep 17 00:00:00 2001 From: arokem Date: Mon, 21 Sep 2015 12:43:25 -0700 Subject: [PATCH 11/11] Activate my env first, so that nbformat gets installed into it. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4bc7373..72a4326 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,12 +25,12 @@ before_install: - conda update conda - conda info -a - travis_retry conda create -n test $CONDA IPython pip nose pyzmq jsonschema + - source activate test - if [[ $CONDA == python=3.3* ]]; then pip install nbformat; else travis_retry conda install nbformat; fi - - source activate test - travis_retry pip install coveralls install: