[Distutils] easy_install: setup.py-less packages

Ian Bicking ianb at colorstudy.com
Mon Jul 4 07:47:12 CEST 2005


Phillip J. Eby wrote:
> At 06:01 PM 7/3/2005 -0500, Ian Bicking wrote:
> 
>> Hi; trying to get back into this again...
>>
>> So, there's a package at http://svn.saddi.com/flup/trunk/ that I want to
>> install, but it has no setup.py file.  I think that file should look
>> something like:
>>
>> from setuptools import setup
>> setup(name="flup",
>>         packages=['flup', 'flup.middleware', 'flup.resolver', 
>> 'flup.server']
>>         version='0.0-devel-r???')
>>
>>
>> And I'd probably add other things, but I think that's all that's
>> required.  So... how should I make this happen?  Should I hardcode
>> 'http://svn.saddi.com/flup/trunk' into the setup.py file?  Can I make
>> the location overrideable with an option?  How do I download the
>> checkout?
> 
> 
> Why don't you just use a subversion "external" to include the package in 
> your own as a subdirectory?  Then use the package_dir setting in setup 
> to refer to the subdirectory.

I'd never looked at those before; that seems to be just right for this. 
  In other cases I might just download the file(s) on my own (e.g., 
archives online, etc.).

> You then publish your wrapping package as a subversion URL.  This won't 
> work for auto-discovery from PyPI unless your URL ends with Flup.egg or 
> something like that, but you can always give it to EasyInstall as a URL, 
> or build eggs and publish those.

Yes.  Hmm... I suppose I could create something that redirected from a 
detectable URL to the actual URL.  That's kind of hacky though.  Only 
being able to list actual eggs decreases the utility of a custom index. 
  Could it also look at title attributes or something?

It would be neat if you could download a working development copy with 
easy_install too.  I'd like to encourage, or at least assist, people who 
want to interact with the code itself; and if you use a checkout you can 
at least use things like svn diff, even if you can't necessarily commit.

>> Should I calculate r??? on my own, and if so where?  Right before I call
>> setup()?  I need the repository location to do so, so if the repository
>> location was overrideable then I'd need to get the real location.
> 
> 
> Note that bdist_egg has an option to pull this for you, although 
> currently it uses the setup.py directory so that doesn't actually help 
> in this case.

Cool... though yes, it wouldn't work quite right here.

>> Once the files are checkout out, how do I put it in place?  Is there a
>> way to set the "base path" for the packages, so I could say "install
>> these packages, found in /tmp/wherever-it-was-downloaded-to"?
> 
> 
> I don't understand.

Nevermind that, I think externals will work for me.

-- 
Ian Bicking  /  ianb at colorstudy.com  / http://blog.ianbicking.org


More information about the Distutils-SIG mailing list