from celery.bin.celery import main as celery_mainfrom twitter.common import app@app.commanddef celery(args, options):"""Wrap the celery cli tool."""celery_args = ['celery'] + argsreturn celery_main(celery_args)app.main()
./the.pex celery -arg -arg arg
celery -arg -arg -arg
./the.pex celery -arg -arg -arg./the.pex gunicorn start -arg -arg -arg
On May 12, 2016 5:22 PM, "Hari" <harip...@gmail.com> wrote:
>
> Thanks for the pointers, Kris. I have a main module with multiple commands are you suggested. However, I'm unable to make this main module as an entry point. The simple example described in https://www.ovni.io/post/pex-the-python-executable does not work for me due to module import issues. Any idea what am I doing wrong?
>
> Here is what I have-
>
> dev % tree hello
> hello
> ├── MANIFEST.in
> ├── __init__.py
> ├── hello.py
> └── setup.py
>
> 0 directories, 4 files
>
> dev % cat hello/MANIFEST.in
> include *.py
>
> dev % cat hello/hello.py
> def hello():
> print "hello!"
>
> dev % cat hello/setup.py
> from setuptools import setup, find_packages
> setup( name='hello', version='0.0.1', packages=find_packages() )
>
> dev % pex hello -e hello:hello -o hello.pex
Try `pex . -e hello:hello -o hello.pex`
IE: s/pex hello .../pex . .../
Pex does not read `MANIFEST.in` iirc, can you update setup.py to include `packages=['.']` as an alternative?