Python 中可重现环境的工具(或工具组合)

发布于 2024-07-14 00:56:37 字数 221 浏览 6 评论 0原文

我曾经是一名java开发人员,我们使用ant或maven等工具以标准化的方式管理我们的开发/测试/UAT环境。 这使我们能够处理库依赖性、设置操作系统变量、编译、部署、运行单元测试以及所有必需的任务。 此外,生成的脚本保证了所有环境几乎均等配置,并且所有任务均由团队的所有成员以相同的方式执行。

我现在开始使用 Python 工作,我想听听您的建议,我应该使用哪些工具来完成与 java 相同的任务。

I used to be a java developer and we used tools like ant or maven to manage our development/testing/UAT environments in a standardized way. This allowed us to handle library dependencies, setting OS variables, compiling, deploying, running unit tests, and all the required tasks. Also, the scripts generated guaranteed that all the environments were almost equally configured, and all the task were performed in the same way by all the members of the team.

I'm starting to work in Python now and I'd like your advice in which tools should I use to accomplish the same as described for java.

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

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

发布评论

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

评论(7

々眼睛长脚气 2024-07-21 00:56:37
  1. virtualenv 创建包含的虚拟环境(防止不同版本的Python或Python包踩踏彼此)。 人们转向使用此工具的呼声越来越高。 作者与 Aaron 提到的旧的working-env.py 相同。

  2. pip 在 vi​​rtualenv 中安装软件包。 传统的方法是 easy_install,正如 S. Lott 所回答的那样,但 pip 与 virtualenv 配合使用效果更好。 easy_install 仍然具有 pip 中没有的功能。

  3. scons 作为构建工具,尽管如果您纯粹使用 Python,则不需要它。

  4. Fabric 粘贴,或 paver 用于部署。

  5. buildbot 用于持续集成。

  6. 用于版本控制的 Bazaar、mercurial 或 git。

  7. Nose 作为单元测试的扩展。

  8. PyFit 用于FIT 测试。

  1. virtualenv to create a contained virtual environment (prevent different versions of Python or Python packages from stomping on each other). There is increasing buzz from people moving to this tool. The author is the same as the older working-env.py mentioned by Aaron.

  2. pip to install packages inside a virtualenv. The traditional is easy_install as answered by S. Lott, but pip works better with virtualenv. easy_install still has features not found in pip though.

  3. scons as a build tool, although you won't need this if you stay purely Python.

  4. Fabric paste, or paver for deployment.

  5. buildbot for continuous integration.

  6. Bazaar, mercurial, or git for version control.

  7. Nose as an extension for unit testing.

  8. PyFit for FIT testing.

紧拥背影 2024-07-21 00:56:37

我还使用 java 和 python。
对于 python 开发,maven 等效项是 setuptools (http://peak.telecommunity.com/DevCenter/setuptools)。 对于 Web 应用程序开发,我将其与 Paste (http://pythonpaste.org/) 结合使用来进行部署过程

I also work with both java and python.
For python development the maven equivalent is setuptools (http://peak.telecommunity.com/DevCenter/setuptools). For web application development I use this in combination with paster (http://pythonpaste.org/) for the deployment process

旧时光的容颜 2024-07-21 00:56:37

除了 easy_install 之外?

对于我们的 Linux 服务器,我们使用 easy_install 和 yum。

对于我们的 Windows 开发笔记本电脑,我们在某些项目中使用 easy_install 和一些 MSI。

我们使用的大多数 Python 库都是纯源代码,因此我们可以在所有机器上使用相同的发行版。 如果我们有一个网络共享设备,我们会把它们全部放在那里。 遗憾的是,我们的基础设施有点分散,因此我们必须移动 .TAR 文件或重做安装来重建环境。

在某些情况下(例如,PIL),我们必须重新编译并检查版本号。

Other than easy_install?

For our Linux servers, we use easy_install and yum.

For our Windows development laptops, we use easy_install and a few MSI's for some projects.

Most of the Python libraries we use are source-only, so we can use the same distribution on all boxes. If we could have a network shared device, we'd put them all there. Sadly, our infrastructure is kind of scattered, so we have to either move .TAR files around or redo the installs to rebuild the environments.

In a few cases (e.g., PIL), we have to recompile and check the version numbers.

旧瑾黎汐 2024-07-21 00:56:37

您将需要 easy_setup 来获取彩蛋(大致就是 Maven 所说的工件)。

要设置您的环境,请查看 working-env.py

Python 不是已编译,但您可以将项目的所有文件放在一个 Egg 中。 这是通过 setuptools 完成的

对于 CI,请检查 这个答案

You will want easy_setup to get the eggs (roughly what Maven calls an artifact).

For setting up your environment, have a look at working-env.py

Python is not compiled but you can put all files for a project in an egg. This is done with setuptools

For CI, check this answer.

财迷小姐 2024-07-21 00:56:37

如果我们不提及 Paver,那就太失职了,它是由 TurboGears 名声大噪。 该项目仍处于 alpha 阶段,但看起来非常有前途。 项目页面的片段:

Paver 是一个基于 Python 的构建/分发/部署脚本工具,类似于 Make 或 Rake。 Paver 的独特之处在于它与常用的 Python 库的集成。 以前很简单的常见任务仍然很简单。 更重要的是,现在处理您的应用程序的特定需求和要求变得更加容易。

We would be remiss not to also mention Paver, which was created by Kevin Dangoor of TurboGears fame. The project is still in alpha, but it appears very promising. A snippet from the project page:

Paver is a Python-based build/distribution/deployment scripting tool along the lines of Make or Rake. What makes Paver unique is its integration with commonly used Python libraries. Common tasks that were easy before remain easy. More importantly, dealing with your applications specific needs and requirements is now much easier.

回首观望 2024-07-21 00:56:37

我正是结合 setuptools 和 Hudson 来完成此操作。 我知道 Hudson 是一个 Java 应用程序,但它可以很好地运行 Python 的东西。

I do exactly this with a combination of setuptools and Hudson. I know Hudson is a java app, but it can run Python stuff just fine.

明月夜 2024-07-21 00:56:37

您可能需要查看我们的 Devenv。 它允许您标准化开发、QA 和 UAT 的构建环境。 它是免费的,就像“免费啤酒”一样。

华泰

You might want to check our Devenv. It allows you to standardize the build environments for development, QA and UAT. It's free as in "free beer".

HTH

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