python dependency + deployment tool?
Does anybody know of a tool to handle module dependencies + deployment in Python?
Details: By handle, I mean:
- list,
- keep track of and
- bundle up a zip/installable file for me.
- Make it trivial to redeploy on another system (ie: includes all modules at the correct version in a deploy file, and does not have to go somewhere to get them *).
- Alerts me if I am about to do something which changes the environment.
- It must follow module dependencies all the way, not just one level deep.
Plus some stuff I probably haven't thought of.
I'm not talking about Virtualenv, Fabric, pip freeze** and (I don't think) Paver.
This evening I tried开发者_运维知识库 to count the modules that Pylons depends on. After a detour into Snakefood and Graphviz, the answer is A LOT. 100+ (and Snakefood did not get them all).
As I'm getting more and more into Python, handling this problem manually is starting to take up more of my time than I would like, and it's unreliable.
If it matters, I use Python 2.7 on Windows 7.
* I know this will introduce some artifacts.
** Combining virtualenv and pip freeze goes some way to solving this, but it's still not what I am looking for.
Setuptools plus pypi is made for that. The setuptools is an enhanced distutils, with which you can specify dependencies. For example, in the setup function:
install_requires = ['simplejson>=2.0,==dev'],
Will pull in that dependency when you use easy_install.
Since you are on windows take a look at py2exe. Something of interest from the py2exe FAQ:
How does py2exe decide which modules you need? To determine which modules should go in the final .exe file, py2exe does a recursive search of the script that you are packaging to find its dependencies and, in turn, all of their dependencies.
精彩评论