-
-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow specifying a script to run in lieu of an entry point #59
Comments
Would this help the following situation? I've had someone try my instructions at http://www.wefearchange.org/2015/04/creating-python-snaps.html but he wasn't able to make it work because his project doesn't use entry points. https://pypi.python.org/pypi/ssh-import-id He just has some scripts that get install in bin. |
sure, I see no reason why it couldn't be used to support that use-case. I've been thinking for a while it'd be useful, as an example of how to use pex as a library, to write a small application that takes a .tar.gz or requirement and spits out pex files for each of its entry_points and scripts that you could then take and drop in ~/local/bin or what have you. |
On Apr 05, 2015, at 10:51 AM, brian wickman wrote:
That would be pretty awesome :) |
I see this issue is closed but when I try to do exactly what is described here pex fails:
It looks exactly like the use case mentioned in the first message, where I did not create a package for my little |
is git-branches.py defined in a scripts=[] array in one of the project setup.py files? |
No, there is no setup.py, just git-branches.py and requirements.txt, I assummed that
meant this case. |
I realise that I can create a minimal from setuptools import setup
setup(name='git-branches', scripts=['git-branches.py']) Then run:
And get a runnable version of my script. I thought this is what this issue was about. If not, is this something that could be somehow integrated? Shall I then open a new request? |
I think opening a new issue for the more general enhancement of doing something sane when the requirement is a directory without a setup.py (whether or not --script is used), would make sense... iff you can supply some reasoning in the issue as to why / how a sane thing can be done. Is recursively globbing *.py from that dir good enough?, are non *.py files handled as resources (package_data) or are you out of luck and must upgrade to writing a setup.py at that point, etc. This general thing was asked about here: http://stackoverflow.com/questions/30654854/python-pex-loading/30678446 |
In case it helps anyone, I've used the latest pex 1.1.10 w/ python27 and had to create a valid setup.py with following content (which I now create dynamically as/when I build a new pex for my script/s)
it also needs a The directory then looks like
I then use
Alex |
If you build a simple flask app but don't want to go through the ceremony of defining a setup.py and the like, you should be able to just do 'pex -r flask_requirements.txt --entry_script=my_flask.py -o my_flask.pex' rather than have to keep the two separate.
The text was updated successfully, but these errors were encountered: