Repository: bokeh/bokeh

Issue:
NameError: name 'jsbuild' is not defined
Seems your setup.py is a bit broken:

```
C:\Users\ionel_000>py -3 -mpip wheel bokeh
Collecting bokeh
  Using cached bokeh-0.8.0.tar.gz
    BokehJS source code is not shipped in sdist packages; building/installing from the bokehjs source directory is disabled. To build or develop BokehJS yourself, you must clone the full Bokeh repository from https://git
hub.com/bokeh/bokeh
    package init file 'bokeh\charts\tests\__init__.py' not found (or not a regular file)
Collecting Flask>=0.10.1 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\Flask-0.10.1-py3-none-any.whl
Collecting Jinja2>=2.7 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\Jinja2-2.7.3-py3-none-any.whl
Collecting MarkupSafe>=0.18 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\MarkupSafe-0.23-cp34-none-win_amd64.whl
Collecting Werkzeug>=0.9.1 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\Werkzeug-0.10.1-py3-none-any.whl
Collecting greenlet>=0.4.1 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\greenlet-0.4.5-cp34-none-win_amd64.whl
Collecting itsdangerous>=0.21 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\itsdangerous-0.24-py3-none-any.whl
Collecting python-dateutil>=2.1 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\python_dateutil-2.4.0-py2.py3-none-any.whl
Collecting pytz==2013b (from bokeh)
  Using cached pytz-2013b.tar.bz2
    C:\Python34\lib\site-packages\setuptools\dist.py:283: UserWarning: The version specified requires normalization, consider using '2013b0' instead of '2013b'.
      self.metadata.version,
Collecting requests>=1.2.3 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\requests-2.5.1-py2.py3-none-any.whl
Collecting six>=1.5.2 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\six-1.9.0-py2.py3-none-any.whl
Collecting pygments>=1.6 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\Pygments-2.0.2-py3-none-any.whl
Collecting pystache>=0.5.3 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\pystache-0.5.4-py3-none-any.whl
Collecting markdown>=2.3.1 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\Markdown-2.5.2-py3-none-any.whl
Collecting PyYAML>=3.10 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\PyYAML-3.11-cp34-none-win_amd64.whl
Collecting pyzmq>=14.3.1 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\pyzmq-14.5.0-cp34-none-win_amd64.whl
Collecting tornado>=4.0.1 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\tornado-4.1-cp34-none-win_amd64.whl
Collecting colorama>=0.2.7 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\colorama-0.3.3-py3-none-any.whl
Collecting numpy>=1.7.1 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\numpy-1.9.1-cp34-none-win_amd64.whl
Collecting pandas>=0.11.0 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\pandas-0.15.2-cp34-none-win_amd64.whl
Collecting certifi (from tornado>=4.0.1->bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\certifi-14.5.14-py2.py3-none-any.whl
Skipping Flask, due to already being wheel.
Skipping Jinja2, due to already being wheel.
Skipping MarkupSafe, due to already being wheel.
Skipping Werkzeug, due to already being wheel.
Skipping greenlet, due to already being wheel.
Skipping itsdangerous, due to already being wheel.
Skipping python-dateutil, due to already being wheel.
Skipping requests, due to already being wheel.
Skipping six, due to already being wheel.
Skipping pygments, due to already being wheel.
Skipping pystache, due to already being wheel.
Skipping markdown, due to already being wheel.
Skipping PyYAML, due to already being wheel.
Skipping pyzmq, due to already being wheel.
Skipping tornado, due to already being wheel.
Skipping colorama, due to already being wheel.
Skipping numpy, due to already being wheel.
Skipping pandas, due to already being wheel.
Skipping certifi, due to already being wheel.
Building wheels for collected packages: bokeh, pytz
  Running setup.py bdist_wheel for bokeh
  Destination directory: c:\users\ionel_000\pip\wheels
  Complete output from command C:\Python34\python.exe -c "import setuptools;__file__='C:\\Users\\IONEL_~1\\AppData\\Local\\Temp\\pip-build-zrp6fik1\\bokeh\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n
'), __file__, 'exec'))" bdist_wheel -d c:\users\ionel_000\pip\wheels:
  Traceback (most recent call last):

    File "<string>", line 1, in <module>

    File "C:\Users\IONEL_~1\AppData\Local\Temp\pip-build-zrp6fik1\bokeh\setup.py", line 336, in <module>

      if jsbuild:

  NameError: name 'jsbuild' is not defined

  ----------------------------------------
  Failed building wheel for bokeh
  Running setup.py bdist_wheel for pytz
  Destination directory: c:\users\ionel_000\pip\wheels
Successfully built pytz
Failed to build bokeh
ERROR: Failed to build one or more wheels
```

This was with latest 3.4:

```
C:\Users\ionel_000>py -3 --version
Python 3.4.3rc1
```

NameError: name 'jsbuild' is not defined
Seems your setup.py is a bit broken:

```
C:\Users\ionel_000>py -3 -mpip wheel bokeh
Collecting bokeh
  Using cached bokeh-0.8.0.tar.gz
    BokehJS source code is not shipped in sdist packages; building/installing from the bokehjs source directory is disabled. To build or develop BokehJS yourself, you must clone the full Bokeh repository from https://git
hub.com/bokeh/bokeh
    package init file 'bokeh\charts\tests\__init__.py' not found (or not a regular file)
Collecting Flask>=0.10.1 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\Flask-0.10.1-py3-none-any.whl
Collecting Jinja2>=2.7 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\Jinja2-2.7.3-py3-none-any.whl
Collecting MarkupSafe>=0.18 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\MarkupSafe-0.23-cp34-none-win_amd64.whl
Collecting Werkzeug>=0.9.1 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\Werkzeug-0.10.1-py3-none-any.whl
Collecting greenlet>=0.4.1 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\greenlet-0.4.5-cp34-none-win_amd64.whl
Collecting itsdangerous>=0.21 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\itsdangerous-0.24-py3-none-any.whl
Collecting python-dateutil>=2.1 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\python_dateutil-2.4.0-py2.py3-none-any.whl
Collecting pytz==2013b (from bokeh)
  Using cached pytz-2013b.tar.bz2
    C:\Python34\lib\site-packages\setuptools\dist.py:283: UserWarning: The version specified requires normalization, consider using '2013b0' instead of '2013b'.
      self.metadata.version,
Collecting requests>=1.2.3 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\requests-2.5.1-py2.py3-none-any.whl
Collecting six>=1.5.2 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\six-1.9.0-py2.py3-none-any.whl
Collecting pygments>=1.6 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\Pygments-2.0.2-py3-none-any.whl
Collecting pystache>=0.5.3 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\pystache-0.5.4-py3-none-any.whl
Collecting markdown>=2.3.1 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\Markdown-2.5.2-py3-none-any.whl
Collecting PyYAML>=3.10 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\PyYAML-3.11-cp34-none-win_amd64.whl
Collecting pyzmq>=14.3.1 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\pyzmq-14.5.0-cp34-none-win_amd64.whl
Collecting tornado>=4.0.1 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\tornado-4.1-cp34-none-win_amd64.whl
Collecting colorama>=0.2.7 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\colorama-0.3.3-py3-none-any.whl
Collecting numpy>=1.7.1 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\numpy-1.9.1-cp34-none-win_amd64.whl
Collecting pandas>=0.11.0 (from bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\pandas-0.15.2-cp34-none-win_amd64.whl
Collecting certifi (from tornado>=4.0.1->bokeh)
  File was already downloaded c:\users\ionel_000\pip\wheels\certifi-14.5.14-py2.py3-none-any.whl
Skipping Flask, due to already being wheel.
Skipping Jinja2, due to already being wheel.
Skipping MarkupSafe, due to already being wheel.
Skipping Werkzeug, due to already being wheel.
Skipping greenlet, due to already being wheel.
Skipping itsdangerous, due to already being wheel.
Skipping python-dateutil, due to already being wheel.
Skipping requests, due to already being wheel.
Skipping six, due to already being wheel.
Skipping pygments, due to already being wheel.
Skipping pystache, due to already being wheel.
Skipping markdown, due to already being wheel.
Skipping PyYAML, due to already being wheel.
Skipping pyzmq, due to already being wheel.
Skipping tornado, due to already being wheel.
Skipping colorama, due to already being wheel.
Skipping numpy, due to already being wheel.
Skipping pandas, due to already being wheel.
Skipping certifi, due to already being wheel.
Building wheels for collected packages: bokeh, pytz
  Running setup.py bdist_wheel for bokeh
  Destination directory: c:\users\ionel_000\pip\wheels
  Complete output from command C:\Python34\python.exe -c "import setuptools;__file__='C:\\Users\\IONEL_~1\\AppData\\Local\\Temp\\pip-build-zrp6fik1\\bokeh\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n
'), __file__, 'exec'))" bdist_wheel -d c:\users\ionel_000\pip\wheels:
  Traceback (most recent call last):

    File "<string>", line 1, in <module>

    File "C:\Users\IONEL_~1\AppData\Local\Temp\pip-build-zrp6fik1\bokeh\setup.py", line 336, in <module>

      if jsbuild:

  NameError: name 'jsbuild' is not defined

  ----------------------------------------
  Failed building wheel for bokeh
  Running setup.py bdist_wheel for pytz
  Destination directory: c:\users\ionel_000\pip\wheels
Successfully built pytz
Failed to build bokeh
ERROR: Failed to build one or more wheels
```

This was with latest 3.4:

```
C:\Users\ionel_000>py -3 --version
Python 3.4.3rc1
```



Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -317,9 +317,7 @@ def parse_jsargs():
 # check for package install, set jsinstall to False to skip prompt
 jsinstall = True
 if not exists(join(ROOT, 'MANIFEST.in')):
-    options = ('install', 'develop', 'sdist', 'egg_info', 'build', 'clean', '--help')
-    installing = any(arg in sys.argv for arg in options)
-    if installing:
+    if "--build_js" in sys.argv or "--install_js" in sys.argv:
         print("BokehJS source code is not shipped in sdist packages; "
               "building/installing from the bokehjs source directory is disabled. "
               "To build or develop BokehJS yourself, you must clone the full "
@@ -328,8 +326,8 @@ def parse_jsargs():
             sys.argv.remove('--build_js')
         if "--install_js"  in sys.argv:
             sys.argv.remove('--install_js')
-        jsbuild = False
-        jsinstall = False
+    jsbuild = False
+    jsinstall = False
 else:
     jsbuild = parse_jsargs()
 


Test patch: