3

Currently my Django project has a huge readme doc, that any developer, whishing to work on the source, must follow to setup their development environment.

It goes something like this:

Prerequisites:

  1. Django Css. See Django CSS.
  2. CleverCSS. See Clever CSS.
  3. Beautiful Soup. See Beautiful Soup.
  4. Dateutil. See python-dateutil.
  5. httplib2 http://code.google.com/p/httplib2/
  6. python-oauth2 https://github.com/simplegeo/python-oauth2
  7. python-twitter http://code.google.com/p/python-twitter/

Is there any facility for writting some sort of script that will fetch the dependencies automatically? At least to automate this process partially to something like:

python setup_environment.py

I've looked at setuptools - but it seems to me that it is more for the purpose of installing the app itself onto the system, not fulfilling the developer's requirements for environment setup.

4
  • What is your target OS ? Commented Jun 29, 2011 at 17:30
  • It should work on any os, linux windows etc. Commented Jun 29, 2011 at 17:34
  • No offense, but that is a pipe dream, I have done the above in linux using simple bash scripts basically either leveraging wget/snv/git to get the source and then calling the boilerplate build (./configure && make && make install) or (python build && sudo python build install) , but its not platform independent. Commented Jun 29, 2011 at 17:35
  • Have you looked into pip? Specifically, virtualenv, pip, and "pip freeze"? Commented Jun 29, 2011 at 17:42

2 Answers 2

6

Will pip not do the job?

http://www.pip-installer.org/en/latest/index.html#

You can freeze all requirements on your server to a file (run this on the server):

pip freeze > REQUIREMENTS.txt

and then on your dev environment:

pip install -r ./REQUIREMENTS.txt

to install everything listed in the REQUIREMENTS file.

You should also look at installing virtualenv (and virtualenvwrapper) as well on your development (and production) server

http://iamzed.com/2009/05/07/a-primer-on-virtualenv/

They allow you to set up multiple encapsulated python environments. This means you can have two django apps set up on the same machine, each with different python versions/python applications/django versions.

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

Comments

0

You also require specific versions of each of these - the ones you built and tested your application against.

But they're all just python modules - ie uncompiled text files. You can put them all with your source such that when they get your code they get all these exact dependencies at the same time. Set pythonpath and you're done.

Works just so long as the package is pure python. Any C libs lurking in there and you're probably back to pip/setuptools/apt/easy - "lxml" i'm talking about you.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.