mitsuhiko / platter

A useful helper for wheel deployments.
Other
335 stars 52 forks source link

WAR implementation #7

Closed dcramer closed 9 years ago

dcramer commented 9 years ago

I've wanted this for ages, and platter seems to be in the position where it could either offer it as a feature, or it could simply be an underlying tool utilized in solving it.

Someone said this jokingly the other day, but for now I'm going to call it a big wheel, but really it's just a zip file with __main__ defined.

To illustrate this concept better, let me use Sentry using the hypothetical API:

$ platter build ~/Development/getsentry --pip-option="-r requirements.txt" --entry-point=sentry.utils.runner:main
=> sentry.bwhl

$ python sentry.bwhl --help
usage: sentry.tgz [--config=/path/to/settings.py] [command] [options]

I think it's pretty clear cut how this could happen, the primary thing being platter assisting with generation of the __main__ file and promoting this as a concept.

dcramer commented 9 years ago

Another idea thats very specific to this, and less so to platter would be to have a way to build a lazy bundle. This would create something similar to the above, but upon execution it would be responsible for installing dependencies/etc.

mitsuhiko commented 9 years ago

This actually already exist: https://pex.readthedocs.org/

Unfortunately I ran into some issues with that and I did not figure out how to fix them. However I have already thought about talking to the guy who maintains that about solving my particular problems.

dcramer commented 9 years ago

If only pex didn't require this arbitrary format. Ideally what would happen is it could create a wrapper around the package. Giving you some kind of environment that is just a virtualenv of sorts, builds the main.py file for you, installs all of the dependencies, and then tarballs it. Asking someone to install pex to run a program is just as easy as asking them to install pip/requirements.

bkad commented 9 years ago

pex doesn't require you to install pex to run the zip files it creates. The zip files are executable on their own, assuming a python interpreter exists in your environment.

dcramer commented 9 years ago

@bkad turns out I was confused when reading the docs