jeads/datasource — pull request #7 by carljm (2012-05-09 00:00:01+00:00)
Title: Better dependency handling in setup.py.

The current import-test for MySQLdb in setup.py is not good dependency-handling practice; if dependencies for some project that uses datasource are being installed via something like a pip requirements file, it's quite likely that MySQLdb and datasource might be installed in the same pip run, and MySQLdb may not be importable yet when datasource's setup.py is first executed. Instead, setuptools' install_requires should be used to list dependencies, which will also allow installers like easy_install and pip to automatically download and install dependencies if necessary. (I've used an import fallback to only use setuptools features if setuptools is actually available; it usually is).

I also removed the permissions-flipping code for data_sources.json, as that's a pretty unusual and unexpected thing to do in a setup.py and I wasn't sure why it would be needed; that code also prevented datasource from being installed via pip because it made unwarranted assumptions about the current working directory being the same directory setup.py is in.

Let me know if I missed something critical!