Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tool (or combination of tools) for reproducible environments in Python

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.

like image 369
Sam Avatar asked Feb 13 '09 12:02

Sam


4 Answers

  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.

like image 88
Van Gale Avatar answered Nov 19 '22 03:11

Van Gale


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

like image 33
jor Avatar answered Nov 19 '22 03:11

jor


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.

like image 40
S.Lott Avatar answered Nov 19 '22 01:11

S.Lott


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.

like image 2
Aaron Digulla Avatar answered Nov 19 '22 01:11

Aaron Digulla