Hello! Anyone tried to run binary with a gunicorn ...
# general
a
Hello! Anyone tried to run binary with a gunicorn flask app? I'm trying to achieve what's described here: https://github.com/pantsbuild/pex/blob/master/docs/recipes.rst#gunicorn-and-pex but I get
Copy code
ImportError: No module named gunicorn.__main__; 'gunicorn' is a package and cannot be directly executed
Here's BUILD file. I assume that
entry_point
do the same thing as
-c
flag in pex?
Copy code
python_binary(
    name = "test_bin",
    dependencies = [
        ":test_lib",
    ],
    entry_point = "gunicorn",
)
e
Your assumption is not correct. entry_point is equivalent to Pex's -e/-m/--entry-point option. For gunicorn the mapping is:
Copy code
$ pex gunicorn -o gunicorn.pex
$ unzip -qc gunicorn.pex .deps/gunicorn-19.9.0-py2.py3-none-any.whl/gunicorn-19.9.0.dist-info/entry_points.txt

    [console_scripts]
    gunicorn=gunicorn.app.wsgiapp:run
    gunicorn_paster=gunicorn.app.pasterapp:run

    [paste.server_runner]
    main=gunicorn.app.pasterapp:paste_server
So you'd need an
entry_point = "gunicorn.app.wsgiapp:run"
.
a
thanks, that's so helpful! 🙂