Maven 相当于 python

发布于 2024-09-10 21:28:15 字数 1539 浏览 8 评论 0原文

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

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

发布评论

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

评论(5

初吻给了烟 2024-09-17 21:28:15

Python 使用 distutils 和 setuptools 进行依赖和打包。

这是一个解释基础知识的教程: http://docs.activestate.com/ activepython/3.2/diveintopython3/html/packaging.html

简而言之,您将拥有 setup.py 文件,其中包含依赖项和脚本编译/安装信息,您可以使用以下命令构建 Egg、dist tarball、二进制 tarball 等它。

Python uses distutils and setuptools for dependency and packaging.

Heres a tutorial which explains basics: http://docs.activestate.com/activepython/3.2/diveintopython3/html/packaging.html

In short, you will have setup.py file, which has dependency and script compilation/installation information, and you can build eggs, dist tarballs, binary tarballs, etc with it.

好倦 2024-09-17 21:28:15

没有直接匹配。但是,您可以获得的最接近的:

  • zc.buildout:它可以设置封闭环境,下载/处理依赖关系、初始化脚本等。它还构建在插件(或他们所说的“食谱”)上。几年前我在它处于测试阶段时使用过它,可能从那时起它就已经进化了。与 Maven 一样,有学习曲线,但它也是最强大的。

其他产品是 Maven/zc.buildout 的子集:

您可能了解 Ant 和 shell 脚本,因此您还可以检查这些 Python 工具:

  • FabricPaver:具有添加功能的命令行任务运行程序。它们将传统的命令行执行包装在 python 中,并允许以更强大的方式管理各种任务(任务依赖性、解释输出、在远程服务器中运行命令等)。基本上没有什么是你用 shell 脚本不能做的,但在 python 中,它就不那么神秘了。

There is no direct match. However, the closest you can get:

  • zc.buildout: It can setup closed environments, download/handle dependencies, initialize scripts, etc. It also builds on plugins (or "recipes", as they call them). I used it a few years ago when it was in beta stages, probably it has evolved since then. There is learning curve, as with Maven, but it's also the most powerful.

Other offerings are subsets of Maven/zc.buildout:

You probably know Ant and shell scripting, so you could check also these Python tools:

  • Fabric or Paver: command-line task runners with added flavors. They wrap your traditional command-line execution in python, and allow to manage various tasks in a more powerful way (task dependencies, interpreting output, running commands in remote server, etc.). Basically nothing you couldn't do with shell scripting, but in python, it's much less cryptic.
只怪假的太真实 2024-09-17 21:28:15

我想指出 PyBuilder 它深受 maven 启发,但使用 python 而不是 XML 进行配置,因此它实际上是可读的,恕我直言。

有一个用于依赖关系管理的插件(在底层使用 pip 并区分构建和运行时依赖关系),并且与 Maven 不同,您可以使用单个命令运行完整的构建生命周期。

I'd like to point out PyBuilder which is heavily inspired by maven but uses python instead of XML for configuration, so it's actually readable, IMHO.

There is a plugin for dependency management (uses pip under the hood and differentiates between build and runtime dependencies) and, not unlike maven, you can run through the full build lifecycle with a single command.

我ぃ本無心為│何有愛 2024-09-17 21:28:15

对于部署,除了 distutils/setuptoos 之外,还可以查看 pip 包(使用下面的 setuptools)。它可以回滚失败的安装并卸载(easy_install/setuptools 中缺少的东西)。此外,您可以通过需求文本文件指定依赖关系。

For deployment, in addition to distutils/setuptoos, also take a look at the pip package (uses setuptools underneath). It can rollback failed installations and also uninstall (something missing from easy_install/setuptools). In addition, you can specify dependencies through a requirements text file.

最丧也最甜 2024-09-17 21:28:15

最好使用 virtualenv 创建独立的项目环境并使用 pip/easy_install 来管理依赖项。

It's good to use virtualenv to create standalone project environment and use pip/easy_install to management dependencies.

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