python 依赖 +部署工具?

发布于 2024-11-09 09:51:08 字数 733 浏览 2 评论 0原文

有人知道Python中有一个处理模块依赖+部署的工具吗?

细节: 我所说的“句柄”是指:为

  • 我列出、
  • 跟踪并
  • 捆绑一个 zip/可安装文件。
  • 使在另一个系统上重新部署变得简单(即:在部署文件中包含正确版本的所有模块,并且不必去某个地方获取它们*)。
  • 如果我要做一些改变环境的事情,就会提醒我。
  • 它必须始终遵循模块依赖关系,而不仅仅是一层深度。
  • 还有一些我可能没有想到的东西。

  • 我不是在谈论 Virtualenv、Fabric、pip freeze** 和(我不认为)Paver。

今天晚上我尝试统计 Pylons 所依赖的模块。绕道了解 Snakefood 和 Graphviz 后,答案是很多。 100+(Snakefood 并没有全部得到)。

随着我越来越喜欢 Python,手动处理这个问题开始占用我比我想要的更多的时间,而且它不可靠。

如果重要的话,我在 Windows 7 上使用 Python 2.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. 

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. 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

寄风 2024-11-16 09:51:08

Setuptools 加上 pypi 是为此而制作的。 setuptools 是增强的 distutils,您可以使用它指定依赖项。例如,在 setup 函数中:

install_requires = ['simplejson>=2.0,==dev'],

当您使用 easy_install 时,将引入该依赖项。

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.

止于盛夏 2024-11-16 09:51:08

由于您使用的是 Windows,请查看 py2exe
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.

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文