Skip to content

Commit

Permalink
Merge pull request #578 from jhprinz/fix_conda_build
Browse files Browse the repository at this point in the history
fix conda-build 2.0 problems
  • Loading branch information
dwhswenson committed Sep 12, 2016
2 parents d967d73 + ecc28ab commit b9b898b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 23 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ script:
- echo travis_fold:end:conda.build.package

# Run tests in _test environment
- source activate _test
- conda create --yes --name test --use-local openpathsampling-dev
- conda info --envs
- source activate test
- conda install --yes jupyter nose nose-timer python-coveralls msmbuilder pyemma ipynbtest
- source devtools/ci/git_hash.sh
- source devtools/ci/nosetests.sh
- source devtools/ci/ipythontests.sh
Expand Down
50 changes: 28 additions & 22 deletions openpathsampling/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,37 @@

__author__ = 'Jan-Hendrik Prinz'

import IPython.display
import IPython.terminal.interactiveshell
import ipykernel.zmqshell


def in_ipynb():
try:
ipython = get_ipython()

if isinstance(ipython, IPython.terminal.interactiveshell.TerminalInteractiveShell):
# we are running inside an IPYTHON console
try:
import IPython
import IPython.display

def in_ipynb():
try:
ipython = get_ipython()

import IPython.terminal.interactiveshell
import ipykernel.zmqshell

if isinstance(ipython, IPython.terminal.interactiveshell.TerminalInteractiveShell):
# we are running inside an IPYTHON console
return False
elif isinstance(ipython, ipykernel.zmqshell.ZMQInteractiveShell):
# we run in an IPYTHON notebook
return True
else:
return False
except NameError:
# No IPYTHON
return False
elif isinstance(ipython, ipykernel.zmqshell.ZMQInteractiveShell):
# we run in an IPYTHON notebook
return True
else:
except:
# No idea, but we should not fail because of that
return False
except NameError:
# No IPYTHON
return False
except:
# No idea, but we should not fail because of that
return False

is_ipynb = in_ipynb()

is_ipynb = in_ipynb()

except ImportError:
is_ipynb = False


def refresh_output(output_str, print_anyway=True, refresh=True,
Expand Down

0 comments on commit b9b898b

Please sign in to comment.