Repository: ipython/ipython

Issue:
tornado needs its own check
Since tornado is a dependency for Notebook a check for it should be added to  setupext/setupext.py and this check should be imported and called by by setupbase.py's check_for_dependencies



Discussion:
there's already a check for tornado in `setup.py`, is this somehow insufficient?

I guess looking at `setup.py` more closely, if `setuptools` is not in sys.modules, it calls setupbase.py's check_for_dependencies which doesn't currently require tornado.

Bingo. I ran into this on a Rackspace-hosted Ubuntu 13.04 system.

what command are you using to install?

git clone https://github.com/ipython/ipython.git
cd ipython
python setup.py install

On Mon, Aug 5, 2013 at 11:51 PM, Paul Ivanov notifications@github.comwrote:

> what command are you using to install?
> 
> —
> Reply to this email directly or view it on GitHubhttps://github.com/ipython/ipython/issues/3916#issuecomment-22156863
> .

Probably worth pointing out that you're going to need to get IPython's submodule dependencies (for the static javascript)

``` bash
23:12:22 (master) ~/code/ipython$ git submodule init
Submodule 'components' (https://github.com/ipython/ipython-components.git) registered for path 'IPython/html/static/components'
23:12:26 (master) ~/code/ipython$ git submodule update
Cloning into 'IPython/html/static/components'...
remote: Counting objects: 1286, done.
remote: Compressing objects: 100% (982/982), done.
remote: Total 1286 (delta 219), reused 1198 (delta 207)
Receiving objects: 100% (1286/1286), 1.99 MiB | 583.00 KiB/s, done.
Resolving deltas: 100% (219/219), done.
Checking connectivity... done
Submodule path 'IPython/html/static/components': checked out '1977b852048ecb05f66d3b8980221080c5decc49'
```

ok, I think I better understand now why the tornado check isn't there: you can install ipython this way, but you don't have a way of expressing that you want to install the notebook dependencies, as well.  Tornado isn't pulled in when you pip or easy_install ipython, for example, only if you install ipython[notebook].

not sure how to proceed here, or if we should do anything about this at all. Wondering what @minrk thinks...

@rgbkrk wrote:

> Probably worth pointing out that you're going to need to get IPython's submodule dependencies:

I think that's not necessary, `python setup.py install` does pull those in for me if I delete them

With regards to @rgbkrk 

`mcrusoe@doozer:~/src/ipython$ python setup.py --user install                                                                                
checking out submodules for the first time
Submodule 'components' (https://github.com/ipython/ipython-components.git) registered for path 'IPython/html/static/components'
Cloning into 'IPython/html/static/components'...
remote: Counting objects: 1286, done.
remote: Compressing objects: 100% (982/982), done.
remote: Total 1286 (delta 219), reused 1198 (delta 207)
Receiving objects: 100% (1286/1286), 1.99 MiB | 663 KiB/s, done.
Resolving deltas: 100% (219/219), done.
Submodule path 'IPython/html/static/components': checked out '1977b852048ecb05f66d3b8980221080c5decc49'
============================================================================`

@ivanov It's certainly in the README and works quite well

``` bash
$ pip install -e .[notebook] # literal brackets
```

@ivanov The other optional dependencies are listed; I looked for which ones were needed for the notebook build

# 

BUILDING IPYTHON
                python: 2.7.3 (default, Apr 10 2013, 06:20:15)  [GCC 4.6.3]
              platform: linux2

OPTIONAL DEPENDENCIES
                sphinx: 1.1.3
              pygments: 1.4
                  nose: 1.1.2
               pexpect: no (required for running standalone doctests)
                 pyzmq: no (required for qtconsole, notebook, and parallel
                        computing capabilities)
              readline: yes
                jinja2: 2.6

@rgbkrk thread jacking? :)  @mr-c started this off by saying he's running in a place without setuptools. No setuptools means no pip ;)

can you guys hop over to [ipython dev chat](http://www.hipchat.com/ghtNzvmfC) so we can discuss this live, this isn't a great medium for a conversation. See you there

ok, summary of the hipchat conversation: this bug is now to just add tornado as a dependency that gets listed at the top of the output of `python setup.py install`

The install message is really just a docs issue, since there is no way to express actual dependencies without setuptools.  Just adding one more entry to setupext should do it.

@minrk yeap, working on it


Resolving patch:
diff --git a/setupbase.py b/setupbase.py
--- a/setupbase.py
+++ b/setupbase.py
@@ -357,7 +357,7 @@ def check_for_dependencies():
         check_for_sphinx, check_for_pygments,
         check_for_nose, check_for_pexpect,
         check_for_pyzmq, check_for_readline,
-        check_for_jinja2
+        check_for_jinja2, check_for_tornado
     )
     print_line()
     print_raw("BUILDING IPYTHON")
@@ -374,6 +374,7 @@ def check_for_dependencies():
     check_for_nose()
     check_for_pexpect()
     check_for_pyzmq()
+    check_for_tornado()
     check_for_readline()
     check_for_jinja2()
 
diff --git a/setupext/setupext.py b/setupext/setupext.py
--- a/setupext/setupext.py
+++ b/setupext/setupext.py
@@ -130,6 +130,16 @@ def check_for_pyzmq():
             " qtconsole, notebook, and parallel computing capabilities)" % zmq.__version__)
             return False
 
+def check_for_tornado():
+    try:
+        import tornado
+    except ImportError:
+        print_status('tornado', "no (required for notebook)")
+        return False
+    else:
+        print_status('tornado', tornado.version)
+        return True
+
 def check_for_readline():
     from distutils.version import LooseVersion
     try:


Test patch: