Repository: bokeh/bokeh

Issue:
missing bokeh entry point (otherwise bokeh.bat) for Windows
hi,

on my windows, I have a "bokeh" file instead of a "bokeh.exe".

Wouldn't it be normal to get an entry point ? something like (but I guess slightly different)

```
    entry_points={
        'console_scripts': [
            'bokeh = bokeh.command.bootstrap:_main',
        ],
    },
```



Discussion:
Hi @stonebig thanks for the issue. None of us are really Windows users so it helps to have some input from folks with experience there. Could you possibly submit a pull request for this we could test out?

> On Jan 7, 2016, at 12:08, stonebig notifications@github.com wrote:
> 
> hi,
> 
> on my windows, I have a "bokeh" file instead of a "bokeh.exe".
> 
> Woudln't it be normal to get an entry point ? something like (but I guess slightly different)
> 
> `    entry_points={
>         'console_scripts': [
>             'bokeh = bokeh.command.bootstrap:_main',
>         ],
>     },
> —
> Reply to this email directly or view it on GitHub.

I'm not an expert in entry point. currently trying to just add a `bokeh.bat` with:

```
@echo off
rem Use python to execute the python script having the same name as this batch
rem file, but without any extension, located in the same directory as this
rem batch file
python "%~dpn0" %*
```

just like it is already for numba repacked by cgohlke.

when I launch my shiny new "bokeh.bat serve timeout.py", Microsoft firewall wakes up in suspicion... is it normal ?

Even If I say "no" to "do you authorize ... to modify your pc", the timeout.py example works.
![bokeh_timeout_py](https://cloud.githubusercontent.com/assets/4312421/12179059/163407b0-b575-11e5-8f9c-32a5f67f5280.GIF)

==> maybe there is an option for bokeh not to raise suspicion on windows ?

There's a bokeh.bat inside Anaconda3 scripts (`Anaconda3\Scripts`)

Here's the content : 

```
@echo off
set PYFILE=%~f0
set PYFILE=%PYFILE:~0,-4%-script.py
"%~f0\..\..\python.exe" "%PYFILE%" %*
```

it allows to start bokeh serve correctly.

You should be able to add port 5006 to an exception list in the firewall.
I think that it's something like a "New Rule" for inbound and outbound connections....

the majority of windows users I know wouldn't dare imagining doing that.

jupyter doesn't raise eyebrows from Microsoft firewall, does it ? (or did I receive also a warning a long time ago ?)

That's why I usually disable the Windows Firewall :-)

a breakthrough idea, I shall consider it :-)

no fix ?

@stonebig it seemed like you had some possible ideas above, so if you could submit a pull request with them it would be a great help. Testing/debugging install and build issues is an enormous time sink, even more so when it means working in VMs, and anything that can help spread the effort is appreciated. 

it would be a blind fix, would you Appveyor check it works ?
https://github.com/bokeh/bokeh/pull/3792

It's not enough, but if it makes it though our CI testing, that's a good sign. :) Once the automated testing is passing, we can put effort into manual testing on VMs.

ok, you have the good sign, but I don't think it means that it's a correct or bad fix.


Resolving patch:
diff --git a/bokeh/__main__.py b/bokeh/__main__.py
--- a/bokeh/__main__.py
+++ b/bokeh/__main__.py
@@ -1,5 +1,10 @@
 import sys
 
-from bokeh.command.bootstrap import main
+from bokeh.command.bootstrap import main as _main
 
-main(sys.argv)
\ No newline at end of file
+def main():
+    # Main entry point (see setup.py)
+    _main(sys.argv)
+
+if __name__ == "__main__":
+    main()
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -584,6 +584,7 @@ def parse_jsargs():
         'bokeh.util.tests',
     ],
     package_data={'bokeh': package_data},
+    entry_points={'console_scripts': ['bokeh = bokeh.__main__:main',], },
     author='Continuum Analytics',
     author_email='info@continuum.io',
     url='http://github.com/bokeh/bokeh',


Test patch:
diff --git a/scripts/jenkins_test b/scripts/jenkins_test
deleted file mode 100755
--- a/scripts/jenkins_test
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-py.test -s --cov=bokeh