[setuptools] "setup.py develop" should bootstrap
Hi, I think the 'develop' command should bootstrap 'setuptools' itself -- like 'install' does. I was Googling around for a possible work-around, but instead I only found others who ran into the same problem: http://www.djangoproject.com/documentation/install/ (See the comments at the bottom of the page.) They try to use 'develop' to install Django, but get "ImportError: No module named pkg_resources" when they try to run it. (Come to think of it, I may have used 'develop' to install Django the first time, but it only worked because I had used 'setuptools' before.) The users of my 'setup.py' script will likely encounter the exact same scenario: their first encounter with 'setuptools' will be checking-out a project from Subversion, and then running "setup.py develop". Anyway, I developed a crude work-around -- just force the setuptools egg to be installed, before calling setup() for real: import setuptools if setuptools.bootstrap_install_from: egg = setuptools.bootstrap_install_from setuptools.bootstrap_install_from = None setuptools.setup(script_args=['easy_install', egg]) setuptools.setup(...) (The above snippet has no warranty of any kind.) --Leif Strand
On Aug 4, 2006, at 1:37 PM, Leif Strand wrote:
Hi,
I think the 'develop' command should bootstrap 'setuptools' itself -- like 'install' does.
I was Googling around for a possible work-around, but instead I only found others who ran into the same problem:
http://www.djangoproject.com/documentation/install/
(See the comments at the bottom of the page.) They try to use 'develop' to install Django, but get "ImportError: No module named pkg_resources" when they try to run it. (Come to think of it, I may have used 'develop' to install Django the first time, but it only worked because I had used 'setuptools' before.)
The users of my 'setup.py' script will likely encounter the exact same scenario: their first encounter with 'setuptools' will be checking- out a project from Subversion, and then running "setup.py develop".
Anyway, I developed a crude work-around -- just force the setuptools egg to be installed, before calling setup() for real:
import setuptools
if setuptools.bootstrap_install_from: egg = setuptools.bootstrap_install_from setuptools.bootstrap_install_from = None setuptools.setup(script_args=['easy_install', egg])
setuptools.setup(...)
Adding setuptools to the install_requires=[] list of the package's setup.py should work. I guess that could be implicit all the time, because most setuptools-using packages want that (and anything with entry points is going to need it). -bob
At 01:37 PM 8/4/2006 -0700, Leif Strand wrote:
Hi,
I think the 'develop' command should bootstrap 'setuptools' itself -- like 'install' does.
I agree, and this should be considered a bug, so it will be fixed in setuptools 0.6c2.
participants (3)
-
Bob Ippolito
-
Leif Strand
-
Phillip J. Eby