proper way to add data dir in buit distribution

Auré Gourrier aurelien.gourrier at yahoo.fr
Tue Oct 19 15:10:37 EDT 2010


Hi all,

Once again I turn to this list for help.
I'm trying to build a ditribution for my python package (Python 2.4).
The package has the following structure:

root
   |- __init__.py
   |- module1.py
   |- ...
   |-moduleN.py
   |-subpackage1.py
        |- __init__.py
        |- module1.py
        |- ...
        |- moduleN.py
   |-subpackage2.py
        |- __init__.py
        |- module1.py
        |- ...
        |- moduleN.py 
        |- datadir
             |- data1.ext
             |- ...
             |- dataN.ext

My setup script looks like:

---
from distutils.core import setup

setup(name='root',
      version='0.1.0',
      modemetadata = 'metadatavalue'
      package_dir = {'root': ''},    
      packages = ['root',
                          'subpackage1',
                          'subpackage2'])
----

My problem is including the data contained in root/subpackage2/dir in the 
distribution.

I tried using the package_data keyword but couldn't get it right (?). There are 
quite a few posts around and they are very contradictory as to whether or not 
this works... sic !

Then, I wrote a script MANIFEST.in dile containing:

include root/subpackage2/dir/*

This worked fine for creating the source distribution for Win32 (.zip) using:

python setup.py sdist

but not for the (Win32) build distribution:

python setup.py bdist_wininst

Can anyone point me in the right direction ? Any help would be much appreciated 
!

Cheers,

Auré



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20101019/5d2550da/attachment.html>


More information about the Python-list mailing list