[Distutils] setup.py develop un-egg-spected result
Oliver Schoenborn
oliver.schoenborn at utoronto.ca
Tue Mar 25 17:52:03 CET 2008
Quoting "Phillip J. Eby" <pje at telecommunity.com>:
> At 12:07 PM 3/25/2008 -0400, Oliver Schoenborn wrote:
>> Quoting "Phillip J. Eby" <pje at telecommunity.com>:
>>
>>> At 10:39 AM 3/25/2008 -0400, Oliver Schoenborn wrote:
>>>> I have a problem with "setup.py develop" installation.
>>>>
>>>> ...
>>>
>>> This use of package_dir is not compatible with 'develop'. For
>>> 'develop' to work on a project, you may not have any non-empty keys in
>>> package_dir. If you want to use develop with this project, you will
>>> have to alter your directory layout so that 'core' is under 'extern',
>>> or else move the 'extern' modules out of 'extern' and up to the
>>> top-level directory, and update (or get rid of) package_dir accordingly.
>>
>> Thanks for your quick reply. That's a pitty, would it be difficult to
>> patch? E.g. from a list of all 'values' in the package_dir then add a
>> line to easy-install.pth:
>>
>> # pseudo code:
>> ...
>> dirs = [os.path.join(os.getcwd(), dd) for key, dd
>> in package_dir.iteritems() if key.find('.') < 0]
>> for dd in dirs:
>> easyinst_pth.write(dd+'\n')
>> ...
>
> ...
>
> In short, it'd be a serious pain, and I haven't see any use cases for
> doing anything with package_dir besides defining a root location for
> packages (e.g. a src/ or lib/ directory). I have no idea why the
> ability to do that was added to distutils in the first place, ...
Well, I ended up restructuring the source to reflect final
installation, ie moved what was in extern into a new src folder, and
move pubsubcore folder into src too. However, I still need to use
package_dir:
setup(...
packages = [''],
package_dir = {'': 'src'},
...
)
How would you do it without package_dir?
Oliver
More information about the Distutils-SIG
mailing list