From 0d5aa6c5068d5500b954a2cfc99b63a59251578b Mon Sep 17 00:00:00 2001 From: "Joseph C. Slater" Date: Sat, 29 Aug 2015 09:16:24 -0400 Subject: [PATCH 1/6] 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 5e8a4b8db5cffdebb43edb1784cb051ad3c6e8b5 Mon Sep 17 00:00:00 2001 From: "Joseph C. Slater" Date: Sat, 29 Aug 2015 09:31:07 -0400 Subject: [PATCH 2/6] 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 3965e2a46c761876d0d91262a97edcb177df5aea Mon Sep 17 00:00:00 2001 From: "Joseph C. Slater" Date: Sat, 29 Aug 2015 11:06:02 -0400 Subject: [PATCH 3/6] 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 28689d084158bd6b84f6407ddb6570084ed1f7f2 Mon Sep 17 00:00:00 2001 From: "Joseph C. Slater" Date: Sat, 29 Aug 2015 15:55:44 -0400 Subject: [PATCH 4/6] 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 dd6961b..2841e7b 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 09b6fba31853cd3a8f80dcf994a7039ebbf08fca Mon Sep 17 00:00:00 2001 From: "Joseph C. Slater" Date: Sat, 29 Aug 2015 16:06:25 -0400 Subject: [PATCH 5/6] 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 2841e7b..80fe297 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 -qq; @@ -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 4a99d30807fb1b9765d71dc7df58cae41288af4a Mon Sep 17 00:00:00 2001 From: "Joseph C. Slater" Date: Sat, 29 Aug 2015 16:11:24 -0400 Subject: [PATCH 6/6] 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 80fe297..2841e7b 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 -qq; @@ -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