11

What tools or best practices are available for tracking and managing dependencies of the software I'm developing? I'm using Python / Django, and to date all my software requirements are open source.

I'm developing a web application that, while modest, has a number of dependencies. At a minimum, I'd like to track the software and version number for these. I suppose I'd also like to track the configurations of the required software, and possibly some system-level stuff (userid, if any, of the process of the instance required software, and required permissions thereof).

(Better yet would be something that would help me set up a server for the application when I'm ready to deploy. Still better would be something that allows me to track the the http and dns name server used to support the app. But rumor has it that puppet is a tool for that sort of thing.)

1 Answer 1

18

Use pip and virtualenv. With virtualenv, you can create a "virtual environment" which has all your Python packages installed into a local directory. With pip install -r, you can install all packages listed in a specific requirements file.

Rough example:

virtualenv /path/to/env --no-site-packages --unzip-setuptools # create virtual environment source /path/to/env/bin/activate # activate environment easy_install pip # install pip into environment source /path/to/env/bin/activate # reload to get access to pip pip install -r requirements.txt 

Where requirements.txt contains lines like this:

django==1.3 

The great thing about this is that requirements.txt serves both as documentation and as part of the installation procedure, so there's no need to synchronize the two.

Sign up to request clarification or add additional context in comments.

5 Comments

Agreed, one update: you can create your own pip packages using setuptools, and they can list their dependencies. If your own code base grows too large you can structure it as independent setuptools packages that depend on each other.
What if one or some of the dependencies are distributions you've written yourself but do not necessarily want to publish in PIP?
@Santa: you can just give the URL to your own internal repo, or even to a zipped package on a server.
Thanks, this sounds like an excellent starting point for getting this stuff under control.
+1 Been using virtualenv and pip, but never knew about requirements.txt

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.