Repository: bokeh/bokeh

Issue:
Automatic devel build only in py27 in the new TravisCI matrix
Since some of the last big PR merged, the travisCI matrix has changed and we need to avoid multiple builds, so we need to only run the automatic procedure with py27 (because of the fab script).



Discussion:

Resolving patch:
diff --git a/bokeh/bokeh_magic.py b/bokeh/bokeh_magic.py
deleted file mode 100644
--- a/bokeh/bokeh_magic.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# This is the bokeh_magic loader and installer, if you want to see the
-# bokeh_magic source code check the following url:
-# https://github.com/bokeh/bokeh/blob/master/extensions/bokeh_magic.py
-
-from __future__ import absolute_import, print_function
-from IPython import get_ipython
-
-
-def install_bokeh_magic():
-    "An alternative way to install the bokeh_magic extension."
-    url = "https://raw.github.com/bokeh/bokeh/master/extensions/bokeh_magic.py"
-    ip.extension_manager.install_extension(url)
-    print("Bokeh_magic has been installed.")
-
-# An alternative way to load the bokeh_magic extension.
-
-ip = get_ipython()
-try:
-    ip.extension_manager.load_extension("bokeh_magic")
-except ImportError:
-    print("You need to install the extension first. \n"
-          "Don't worry, we will do it for you.")
-    install_bokeh_magic()
-    ip.extension_manager.load_extension("bokeh_magic")
diff --git a/extensions/bokeh_magic.py b/extensions/bokeh_magic.py
deleted file mode 100644
--- a/extensions/bokeh_magic.py
+++ /dev/null
@@ -1,224 +0,0 @@
-# -*- coding: utf-8 -*-
-
-#-----------------------------------------------------------------------------
-#  Copyright (C) 2014  Bokeh Development Team
-#
-#  The license is in the LICENCE.txt, distributed as part of this software.
-#-----------------------------------------------------------------------------
-
-#-----------------------------------------------------------------------------
-# Imports
-#-----------------------------------------------------------------------------
-
-import IPython
-from IPython.core.magic import (Magics, magics_class, line_magic)
-from IPython.testing.skipdoctest import skip_doctest
-from IPython.core.magic_arguments import (argument, magic_arguments,
-    parse_argstring)
-from IPython.core.error import UsageError
-try:
-    from bokeh.plotting import (output_notebook, show, hold, figure)
-    old_bokeh = False
-except ImportError:
-    old_bokeh = True
-
-#-----------------------------------------------------------------------------
-# Classes and functions
-#-----------------------------------------------------------------------------
-
-
-@magics_class
-class BokehMagics(Magics):
-    """Magic to embed Bokeh into the IPython notebook."""
-
-    if old_bokeh:
-        raise DeprecationWarning("%bokeh magic is deprecated, "
-                                 "and will not work in versions > 0.7.1")
-
-    if IPython.__version__.startswith("1"):
-        is_ipytwo = False
-    else:
-        is_ipytwo = True
-
-    has_run = False
-
-    @skip_doctest
-    @magic_arguments()
-    @argument('-n', '--notebook', action="store_true",
-              help='This option enable the execution of the Bokeh '
-              'output_notebook() funtion.')
-    @argument('-f', '--figure', action="store_true",
-              help='This option enable the execution of the Bokeh figure() '
-              'function at the start of each cell.')
-    @argument('-f-off', '--figure-off', action="store_true",
-              help='This option disable the execution of the Bokeh figure() '
-              'function at the start of each cell.')
-    @argument('-h', '--hold', action="store_true",
-              help='This option enable the execution of the Bokeh hold() '
-              'function at the start of each cell.')
-    @argument('-h-off', '--hold-off', action="store_true",
-              help='This option disable the execution of the Bokeh hold() '
-              'function at the start of each cell.')
-    @argument('-s', '--show', action="store_true",
-              help='This option enable the execution of the Bokeh show() '
-              'function at the end of each cell.')
-    @argument('-s-off', '--show-off', action="store_true",
-              help='This option disable the execution of the Bokeh show() '
-              'function at the end of each cell.')
-    @line_magic
-    def bokeh(self, arg, line=None):
-        """ Set up Bokeh to work interactively.
-
-        This function lets you activate bokeh interactive support
-        at any point during an IPython session. It does not import any other
-        bokeh objects into the interactive namespace.
-
-        Examples
-        --------
-
-
-            In [1]: %install_ext url_for_bokeh_extension
-
-            In [2]: %load_ext bokeh_magic
-
-        To load it each time IPython starts, list it in your configuration file:
-
-            c.InteractiveShellApp.extensions = ['bokeh_magic']
-
-        To enable bokeh for usage with the IPython Notebook::
-
-            In [3]: %bokeh --notebook [-n]
-
-        Then you can use a several `modes` (show, hold, figure)::
-
-            In [4]: %bokeh --show [-s] # to enable the autoshow function
-
-            In [5]: %bokeh --show-off [-s-off] to disable the autoshow function
-
-        You can add concatenate `modes` as arguments::
-
-            In [6]: %bokeh --notebook [-n] --show-off [-s-off]
-
-        Note: In order to actually use this magic, you need to have
-        get_ipython(), so you need to have a running IPython kernel.
-        """
-
-        # Get the current running IPython instance.
-        ip = get_ipython()
-
-        # Parse the arguments.
-        args = parse_argstring(self.bokeh, arg)
-
-        # Activate/deactivate the execution of func accordingly with the args.
-        if args.notebook:
-            # Configuring embedded BokehJS mode.
-            if not self.has_run:
-                self.notebook_output()
-
-        if args.figure:
-            if not self.has_run:
-                self.notebook_output()
-            # Register the figure function.
-            if self.is_ipytwo:
-                ip.events.register('pre_run_cell', figure)
-                print("Automatic figure() is enabled.")
-            else:
-                #ip.set_hook('pre_run_code_hook', figure)  # not working
-                print("The --figure mode is not supported for this version of IPython.")
-        elif args.figure_off:
-            if not self.has_run:
-                self.notebook_output()
-            if self.is_ipytwo:
-                try:
-                    # Unregister a figure function.
-                    ip.events.unregister('pre_run_cell', figure)
-                    print("Automatic figure() is disabled.")
-                except ValueError:
-                    raise UsageError("""You have to enable the --figure mode before trying to disable it.""")
-            else:
-                print("The --figure mode is not supported for this version of IPython.")
-
-        if args.hold:
-            if not self.has_run:
-                self.notebook_output()
-            # Register the hold function.
-            if self.is_ipytwo:
-                try:
-                    ip.events.unregister('pre_run_cell', self._hold_false)
-                    ip.events.register('pre_run_cell', self._hold_true)
-                except ValueError:
-                    ip.events.register('pre_run_cell', self._hold_true)
-                print("Automatic hold() is enabled.")
-            else:
-                ip.set_hook('pre_run_code_hook', hold)
-                print("Automatic hold() is irreversible for IPython 1.x. Just restart your kernel to disable.")
-        elif args.hold_off:
-            if not self.has_run:
-                self.notebook_output()
-            if self.is_ipytwo:
-                try:
-                    # Unregister a figure function.
-                    ip.events.unregister('pre_run_cell', self._hold_true)
-                    ip.events.register('pre_run_cell', self._hold_false)
-                    print("Automatic hold() is disabled.")
-                except ValueError:
-                    raise UsageError("""You have to enable the --hold mode before trying to disable it.""")
-            else:
-                print("Automatic hold() can not be disabled for IPython 1.x without restarting your kernel. Did you activate it before?")
-
-        if args.show:
-            if not self.has_run:
-                self.notebook_output()
-            # Register a function for calling after code execution.
-            if self.is_ipytwo:
-                ip.events.register('post_run_cell', self.notebook_show)
-            else:
-                ip.register_post_execute(self.notebook_show)
-            print("Automatic show() is enabled.")
-        elif args.show_off:
-            if not self.has_run:
-                self.notebook_output()
-            if self.is_ipytwo:
-                try:
-                    # Unregister a function
-                    ip.events.unregister('post_run_cell', self.notebook_show)
-                    print("Automatic show() is disabled.")
-                except ValueError:
-                    raise UsageError("""You have to enable the --show mode before trying to disable it.""")
-            else:
-                try:
-                    # Unregister a function from the _post_execute dict.
-                    del ip._post_execute[self.notebook_show]
-                    print("Automatic show() is disabled.")
-                except KeyError:
-                    raise UsageError("""You have to enable the --show mode before trying to disable it.""")
-
-    def notebook_output(self):
-        """Wrapper to execute the open notebook function just once to avoid 
-        a javascript annoying bug when it is called multiple times."""
-        output_notebook()
-        self.has_run = True
-
-    def notebook_show(self):
-        "Wrapper to avoid the exception when the cell does not contain a plot."
-        try:
-            show()
-        except AttributeError as e:
-            # no plot object in the current cell gives us an AttributeError
-            if str(e) != "'NoneType' object has no attribute 'get_ref'":
-                raise
-            else:
-                pass
-
-    def _hold_true(self):
-        "Wrapper to set up the the hold function to True to avoid toggling."
-        hold(True)
-
-    def _hold_false(self):
-        "Wrapper to set up the the hold function to True to avoid toggling."
-        hold(False)
-
-
-def load_ipython_extension(ip):
-    ip.register_magics(BokehMagics)
-    print("Bokeh magic loaded.")


Test patch:
diff --git a/sphinx/source/docs/dev_guide/testing.rst b/sphinx/source/docs/dev_guide/testing.rst
--- a/sphinx/source/docs/dev_guide/testing.rst
+++ b/sphinx/source/docs/dev_guide/testing.rst
@@ -38,7 +38,7 @@ from the top level directory by executing:
 
 .. code-block:: sh
 
-    BOKEH_DEFAULT_NO_DEV=True nosetests
+    nosetests
 
 .. note::
     Currently this script does not support Windows.
diff --git a/tests/travis/test b/tests/travis/test
--- a/tests/travis/test
+++ b/tests/travis/test
@@ -62,8 +62,6 @@ parser.add_argument("-t", "--timeout", type=int, default=default_timeout,
                     help="how long can an example run (in seconds)")
 parser.add_argument("-v", "--verbose", action="store_true", default=False,
                     help="show console messages")
-parser.add_argument("-D", "--no-dev", dest="dev", action="store_false", default=True,
-                    help="don't use development JavaScript and CSS files")
 parser.add_argument("-all-n", "--all-notebooks", action="store_true", default=False,
                     help="test all the notebooks inside examples/plotting/notebook folder.")
 parser.add_argument("-o", "--output-cells", type=str, choices=['complain', 'remove', 'ignore'], default='complain',
@@ -111,13 +109,6 @@ def ok(msg=None):
     msg = " " + msg if msg is not None else ""
     write("%s%s" % (green("[OK]"), msg))
 
-DEFAULT_NO_DEV = os.environ.get('BOKEH_DEFAULT_NO_DEV', 'false')
-if DEFAULT_NO_DEV.lower() in ["true", "yes", "on", "1"]:
-    args.dev = False
-elif DEFAULT_NO_DEV.lower() not in ["false", "no", "off", "0"]:
-    write("unexpected value for BOKEH_DEFAULT_NO_DEV environmental variable, %s" % DEFAULT_NO_DEV)
-    sys.exit(1)
-
 write("%s Using configuration:" % green(">>>"))
 write("%s patterns      = %s" % (green("---"), args.patterns))
 write("%s bokeh-port    = %s" % (green("---"), args.bokeh_port))
@@ -125,7 +116,6 @@ write("%s ipython-port  = %s" % (green("---"), args.ipython_port))
 write("%s phantomjs     = %s" % (green("---"), args.phantomjs))
 write("%s timeout       = %s" % (green("---"), args.timeout))
 write("%s verbose       = %s" % (green("---"), args.verbose))
-write("%s dev           = %s" % (green("---"), args.dev))
 write("%s all-notebooks = %s" % (green("---"), args.all_notebooks))
 write("%s output-cells  = %s" % (green("---"), args.output_cells))
 write("%s log-file      = %s" % (green("---"), args.log_file.name))
@@ -281,9 +271,6 @@ def make_env():
     env = os.environ.copy()
     env['BOKEH_RESOURCES'] = 'relative'
     env['BOKEH_BROWSER'] = 'none'
-    if args.dev:
-        env['BOKEH_RESOURCES'] += '-dev'
-        env['BOKEH_PRETTY'] = 'yes'
     return env
 
 class Timeout(Exception):
@@ -461,9 +448,6 @@ def start_bokeh_server():
     cmd = ["python", "-c", "import bokeh.server; bokeh.server.run()"]
     argv = ["--bokeh-port=%s" % args.bokeh_port, "--backend=memory"]
 
-    if args.dev:
-        argv.extend(["--splitjs", "--debugjs", "--filter-logs"])
-
     try:
         proc = subprocess.Popen(cmd + argv, stdout=args.log_file, stderr=args.log_file)
     except OSError: