by sillysaurus3 · 9y ago · 0 comments
The idea is that we all have global pip installations, which is great for hacking. I have a ton of Python scripts that depend on my pip installs. All my scripts run successfully on my box. The goal is to be able to send you one of my scripts along with <that-list>, then you can run "<magic> run <that-list> foo.py" on your box, and everything "just works."
That way there is literally zero configuration. I don't have to tell any tool anything, and it's effortless for you to run it with all the benefits of a virtualenv.
The biggest problem with this though is that this will make the other person install _all_ your installed packages, rather than just the ones needed for the particular script.
The magic of zc.buildout is in the recipe which is a normal Python module that allowed zc.buildout to be extended to do plenty of things (e.g. managing supervisord[3], installing postgres[4], etc.).
[1]: http://www.buildout.org/en/latest/index.html
[2]: https://github.com/buildout/buildout/blob/9a4b330338e63992dc...
[3]: https://pypi.python.org/pypi/collective.recipe.supervisor/0....
[4]: https://pypi.python.org/pypi/birdhousebuilder.recipe.postgre...
http://docs.buildout.org/en/latest/
Personally, I lean towards small, simple projects that are well-served by virtualenv - but for large, complex projects I think a tool like buildout will remain necessary.
You could come up with a half baked decent try by using the ast module to find foo.py deps and indexing pypi for provided package names. Complexity lies in where package names might intersect, but this is a half baked try after all.