Merge pull request #372 from minrk/require-notebook-4

drop support for single-user server from IPython 3.x
This commit is contained in:
Min RK
2016-02-09 14:42:12 +01:00
2 changed files with 13 additions and 24 deletions

View File

@@ -25,7 +25,7 @@ Basic principles:
## Dependencies ## Dependencies
JupyterHub requires [IPython](https://ipython.org/install.html) >= 3.0 (current master) and [Python](https://www.python.org/downloads/) >= 3.3. JupyterHub itself requires [Python](https://www.python.org/downloads/) 3.3. To run the single-user servers (which may be on the same system as the Hub or not), [Jupyter Notebook](https://jupyter.readthedocs.org/en/latest/install.html) ≥ 4 is required.
Install [nodejs/npm](https://www.npmjs.com/), which is available from your Install [nodejs/npm](https://www.npmjs.com/), which is available from your
package manager. For example, install on Linux (Debian/Ubuntu) using: package manager. For example, install on Linux (Debian/Ubuntu) using:
@@ -50,14 +50,15 @@ Notes on the `pip` command used in the installation directions below:
## Installation ## Installation
JupyterHub can be installed with pip: JupyterHub can be installed with pip, and the proxy with npm:
npm install -g configurable-http-proxy
pip3 install jupyterhub pip3 install jupyterhub
If you plan to run notebook servers locally, you may also need to install the If you plan to run notebook servers locally, you may also need to install the
Jupyter ~~IPython~~ notebook: Jupyter ~~IPython~~ notebook:
pip3 install notebook pip3 install --upgrade notebook
### Development install ### Development install

30
scripts/jupyterhub-singleuser Executable file → Normal file
View File

@@ -17,34 +17,22 @@ from jinja2 import ChoiceLoader, FunctionLoader
from tornado import ioloop from tornado import ioloop
from tornado.web import HTTPError from tornado.web import HTTPError
try:
import notebook
except ImportError:
raise ImportError("JupyterHub single-user server requires notebook >= 4.0")
from IPython.utils.traitlets import ( from traitlets import (
Integer, Integer,
Unicode, Unicode,
CUnicode, CUnicode,
) )
try: from notebook.notebookapp import NotebookApp, aliases as notebook_aliases
import notebook from notebook.auth.login import LoginHandler
# 4.x from notebook.auth.logout import LogoutHandler
except ImportError:
from IPython.html.notebookapp import NotebookApp, aliases as notebook_aliases
from IPython.html.auth.login import LoginHandler
from IPython.html.auth.logout import LogoutHandler
from IPython.html.utils import url_path_join from notebook.utils import url_path_join
from distutils.version import LooseVersion as V
import IPython
if V(IPython.__version__) < V('3.0'):
raise ImportError("JupyterHub Requires IPython >= 3.0, found %s" % IPython.__version__)
else:
from notebook.notebookapp import NotebookApp, aliases as notebook_aliases
from notebook.auth.login import LoginHandler
from notebook.auth.logout import LogoutHandler
from notebook.utils import url_path_join
# Define two methods to attach to AuthenticatedHandler, # Define two methods to attach to AuthenticatedHandler,