← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jonas-drange/js-oopsd/conditional-setuptools-import into lp:js-oopsd

 

Jonas G. Drange has proposed merging lp:~jonas-drange/js-oopsd/conditional-setuptools-import into lp:js-oopsd.

Commit message:
consumers of js-oopsd can now use setuptools, if installed, to pull down dependencies listed in install_requires

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~jonas-drange/js-oopsd/conditional-setuptools-import/+merge/178017

Proposed fix
importing setuptools if it exists, keep using distutils if not

Pre-implementation notes
Since I have limited knowledge about python distribution I discussed this with a fellow developer and concluded that distutils emits warnings when encountering the install_requires list because it does not know what to do with it. setuptools do know how to deal with install_requires

Implementation
conditional import of setuptools in setup.py
-- 
https://code.launchpad.net/~jonas-drange/js-oopsd/conditional-setuptools-import/+merge/178017
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jonas-drange/js-oopsd/conditional-setuptools-import into lp:js-oopsd.
=== modified file 'setup.py'
--- setup.py	2012-09-09 03:15:40 +0000
+++ setup.py	2013-08-01 08:33:36 +0000
@@ -14,9 +14,11 @@
 #
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
-  
 
-from distutils.core import setup
+try:
+    from setuptools import setup
+except ImportError:
+    from distutils.core import setup
 import os.path
 
 description = file(