[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-distutils-sig
Subject:    [Distutils] [issue103] develop command needs a way to install extra
From:       Tres Seaver <setuptools () bugs ! python ! org>
Date:       2010-02-22 23:48:51
Message-ID: 1266882531.4.0.246872311842.issue103 () psf ! upfronthosting ! co ! za
[Download RAW message or body]

New submission from Tres Seaver <tseaver@palladion.com>:

When running 'python setup.py develop', it would be useful to install one (=
or
more) of the 'extra' requirements for the package-under-development.  The
attached patch allows installing one at a time:  I don't have the options f=
u to
make it a repeatable option.

----------
assignedto: pje
files: setuptools-develop_w_extra.patch
messages: 506
nosy: pje, tseaver
priority: feature
status: unread
title: develop command needs a way to install extra requirements
Added file: http://bugs.python.org/setuptools/file67/setuptools-develop_w_e=
xtra.patch

_______________________________________________
Setuptools tracker <setuptools@bugs.python.org>
<http://bugs.python.org/setuptools/issue103>
_______________________________________________
["setuptools-develop_w_extra.patch" (text/x-diff)]

--- lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/develop.py.orig	2010-02-22 \
                18:21:59.000000000 -0500
+++ lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/develop.py	2010-02-22 \
18:34:40.000000000 -0500 @@ -1,6 +1,7 @@
 from setuptools.command.easy_install import easy_install
 from distutils.util import convert_path
 from pkg_resources import Distribution, PathMetadata, normalize_path
+from pkg_resources import Requirement
 from distutils import log
 from distutils.errors import *
 import sys, os, setuptools, glob
@@ -13,6 +14,7 @@
     user_options = easy_install.user_options + [
         ("uninstall", "u", "Uninstall this source package"),
         ("egg-path=", None, "Set the path to be used in the .egg-link file"),
+        ("extra=", None, "Install dependencies for the given 'extra'"),
     ]
 
     boolean_options = easy_install.boolean_options + ['uninstall']
@@ -30,6 +32,7 @@
     def initialize_options(self):
         self.uninstall = None
         self.egg_path = None
+        self.extra = {}
         easy_install.initialize_options(self)
         self.setup_path = None
         self.always_copy_from = '.'   # always copy eggs installed in curdir
@@ -67,7 +70,7 @@
         self.dist = Distribution(
             target,
             PathMetadata(target, os.path.abspath(ei.egg_info)),
-            project_name = ei.egg_name
+            project_name = ei.egg_name,
         )
 
         p = self.egg_base.replace(os.sep,'/')
@@ -99,7 +102,11 @@
             f.close()
         # postprocess the installed distro, fixing up .pth, installing scripts,
         # and handling requirements
-        self.process_distribution(None, self.dist, not self.no_deps)
+        if self.extra:
+            rqmt = Requirement(self.dist.project_name, (), [self.extra])
+        else:
+            rqmt = None
+        self.process_distribution(rqmt, self.dist, not self.no_deps)
 
 
     def uninstall_link(self):



_______________________________________________
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic