热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

用于Python中的可再现环境的工具(或工具的组合)-Tool(orcombinationoftools)forreproducibleenvironmentsinPython

Iusedtobeajavadeveloperandweusedtoolslikeantormaventomanageourdevelopmenttesting

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.

我曾经是一名java开发人员,我们使用ant或maven之类的工具以标准化的方式管理我们的开发/测试/UAT环境。这允许我们处理库依赖、设置OS变量、编译、部署、运行单元测试以及所有必需的任务。而且,生成的脚本保证了所有的环境几乎都得到了相同的配置,团队的所有成员都以相同的方式执行所有任务。

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.

我现在开始在Python中工作,我希望您建议我应该使用哪些工具来实现与java相同的功能。

7 个解决方案

#1


18  

  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.

    virtualenv创建一个包含的虚拟环境(防止不同版本的Python或Python包互相踩踏)。越来越多的人使用这个工具。作者与较老的工作环境相同。py提到的亚伦。

  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.

    pip在virtualenv中安装包。传统的方法是按照S. Lott的回答easy_install,但是pip在virtualenv中工作得更好。easy_install仍然具有pip中没有的特性。

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

    scons是一种构建工具,但是如果您只使用Python,就不需要它。

  4. Fabric paste, or paver for deployment.

    织物浆糊,或摊铺机用于部署。

  5. buildbot for continuous integration.

    buildbot持续集成。

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

    版本控制的Bazaar、mercurial或git。

  7. Nose as an extension for unit testing.

    鼻子作为单元测试的扩展。

  8. PyFit for FIT testing.

    PyFit FIT测试。

#2


3  

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

我还使用java和python。对于python开发来说,与maven等价的是setuptools (http://peak.telecommunity.com/DevCenter/setuptools)。对于web应用程序开发,我将它与paster (http://pythonpaste.org/)结合用于部署过程

#3


2  

Other than easy_install?

除了easy_install吗?

For our Linux servers, we use easy_install and yum.

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

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

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

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.

我们使用的大多数Python库都是源代码库,所以我们可以在所有的盒子上使用相同的发行版。如果我们有一个网络共享设备,我们会把它们都放在那里。遗憾的是,我们的基础设施有点分散,所以我们要么移动. tar文件,要么重新安装,以重新构建环境。

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

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

#4


2  

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

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

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

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

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

Python不是编译的,但是您可以将项目的所有文件放在一个鸡蛋中。这是使用setuptools完成的

For CI, check this answer.

对于CI,检查这个答案。

#5


2  

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:

我们很遗憾,更不用说帕弗了,它是由涡轮齿轮公司的Kevin Dangoor创建的。这个项目仍在alpha阶段,但看起来很有希望。项目页面中的一个片段:

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.

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

#6


0  

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.

我用setuptools和Hudson来做这个。我知道Hudson是一个java应用,但是它可以很好地运行Python。

#7


0  

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".

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

HTH

HTH


推荐阅读
  • IjustinheritedsomewebpageswhichusesMooTools.IneverusedMooTools.NowIneedtoaddsomef ... [详细]
  • Java学习笔记之面向对象编程(OOP)
    本文介绍了Java学习笔记中的面向对象编程(OOP)内容,包括OOP的三大特性(封装、继承、多态)和五大原则(单一职责原则、开放封闭原则、里式替换原则、依赖倒置原则)。通过学习OOP,可以提高代码复用性、拓展性和安全性。 ... [详细]
  • 使用eclipse创建一个Java项目的步骤
    本文介绍了使用eclipse创建一个Java项目的步骤,包括启动eclipse、选择New Project命令、在对话框中输入项目名称等。同时还介绍了Java Settings对话框中的一些选项,以及如何修改Java程序的输出目录。 ... [详细]
  • TerraformVersionTerraformv0.9.11AffectedResource(s)Pleas ... [详细]
  • VScode格式化文档换行或不换行的设置方法
    本文介绍了在VScode中设置格式化文档换行或不换行的方法,包括使用插件和修改settings.json文件的内容。详细步骤为:找到settings.json文件,将其中的代码替换为指定的代码。 ... [详细]
  • Linux重启网络命令实例及关机和重启示例教程
    本文介绍了Linux系统中重启网络命令的实例,以及使用不同方式关机和重启系统的示例教程。包括使用图形界面和控制台访问系统的方法,以及使用shutdown命令进行系统关机和重启的句法和用法。 ... [详细]
  • 本文介绍了九度OnlineJudge中的1002题目“Grading”的解决方法。该题目要求设计一个公平的评分过程,将每个考题分配给3个独立的专家,如果他们的评分不一致,则需要请一位裁判做出最终决定。文章详细描述了评分规则,并给出了解决该问题的程序。 ... [详细]
  • Go Cobra命令行工具入门教程
    本文介绍了Go语言实现的命令行工具Cobra的基本概念、安装方法和入门实践。Cobra被广泛应用于各种项目中,如Kubernetes、Hugo和Github CLI等。通过使用Cobra,我们可以快速创建命令行工具,适用于写测试脚本和各种服务的Admin CLI。文章还通过一个简单的demo演示了Cobra的使用方法。 ... [详细]
  • 本文讨论了在openwrt-17.01版本中,mt7628设备上初始化启动时eth0的mac地址总是随机生成的问题。每次随机生成的eth0的mac地址都会写到/sys/class/net/eth0/address目录下,而openwrt-17.01原版的SDK会根据随机生成的eth0的mac地址再生成eth0.1、eth0.2等,生成后的mac地址会保存在/etc/config/network下。 ... [详细]
  • JDK源码学习之HashTable(附带面试题)的学习笔记
    本文介绍了JDK源码学习之HashTable(附带面试题)的学习笔记,包括HashTable的定义、数据类型、与HashMap的关系和区别。文章提供了干货,并附带了其他相关主题的学习笔记。 ... [详细]
  • 数组的排序:数组本身有Arrays类中的sort()方法,这里写几种常见的排序方法。(1)冒泡排序法publicstaticvoidmain(String[]args ... [详细]
  • (三)多表代码生成的实现方法
    本文介绍了一种实现多表代码生成的方法,使用了java代码和org.jeecg框架中的相关类和接口。通过设置主表配置,可以生成父子表的数据模型。 ... [详细]
  • Whatsthedifferencebetweento_aandto_ary?to_a和to_ary有什么区别? ... [详细]
  • Introduction(简介)Forbeingapowerfulobject-orientedprogramminglanguage,Cisuseda ... [详细]
  • 用户视图(查看运行状态或其他参数)系统视图(配置设备的系统参数)system-viewEntersystemview,returnuservi ... [详细]
author-avatar
阳光而灿烂61
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有