[Answered ]-Set up new development environment with virtualenv and pip in one command

2👍

Automating the setting-up of development environments in Python as well as other languages is getting a lot of attention recently. As a result, there is a variety of solutions available depending on your requirements.

Generally, there is a trade-off involved with these solutions: The more isolation a given solution provides, the more overhead it has. Following is a non-exclusive list of stuff that I have tried and found useful. This list is in ascending order of isolation and therefore overhead:

1) Fabric

“It provides a basic suite of operations for executing local or remote shell commands
(normally or via sudo) and uploading/downloading files, as well as auxiliary
functionality such as prompting the running user for input, or aborting execution.”

2) cookiecutter

“A command-line utility that creates projects from cookiecutters (project templates).
E.g. Python package projects, jQuery plugin projects.”

3) docker

“An open source project to pack, ship and run any application as a lightweight container.”

4) Vagrant

“Create and configure lightweight, reproducible, and portable development environments.”

I have included Vagrant for completeness. It is essentially a tool for programmatic creation of virtual machines and therefore lies at the bottom of the list. As you have mentioned, if you are not too excited about the overhead of the VM with its own OS and API stack etc. you should go for one of the first three options – all of which are Pythonic to some extent in being DRY etc.

Personally, based on the limited perspective that I can glean from your problem statement, I would look at cookiecutter.

0👍

Vagrant is what you need.

Once created, developlemt environment is easily distribute among developers.

Another suggestion that I used for a long time – create binary packages rpm/deb for your applications.

There are pros and cons for both approaches and moreover they can be applied in conjunction.

In my opinion there is no Pythonic way to do the stuff. Fabric could be handy but it have another application area.

Leave a comment