Message67659
For python2.4:
Python 2.4.4 (#2, Apr 15 2008, 23:43:20)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
The distutils documentation says to use an empty string in the
setup() 'package_dir' param. for current dir. It works fine for python
modules, but it fails when using 'package_data' param. For example:
.
|-- __init__.py
|-- module1.py
|-- module2.py
|-- setup.py
`-- view
|-- __init__.py
|-- module3.glade
|-- module3.py
|-- module4.glade
`-- module4.py
setup.py:
from distutils.core import setup
setup(name='my_package',
package_dir={'my_package': ''},
packages=['my_package', 'my_package.view'],
package_data={'my_package': ['view/*.glade']}
)
$ python setup.py build
running build
running build_py
creating build
creating build/lib
creating build/lib/my_package
copying module1.py -> build/lib/my_package
copying module2.py -> build/lib/my_package
copying __init__.py -> build/lib/my_package
creating build/lib/my_package/view
copying view/module3.py -> build/lib/my_package/view
copying view/module4.py -> build/lib/my_package/view
copying view/__init__.py -> build/lib/my_package/view
creating build/lib/my_package/iew
error: can't copy 'iew/module3.glade': doesn't exist or not a regular
file
To correct this, '.' should be used instead of the empty string:
from distutils.core import setup
setup(name='my_package',
package_dir={'my_package': '.'},
packages=['my_package', 'my_package.view'],
package_data={'my_package': ['view/*.glade']}
)
Note that the empty string works fine on python2.5:
Python 2.5.2 (r252:60911, Apr 17 2008, 13:15:05)
[GCC 4.2.3 (Debian 4.2.3-3)] on linux2 |
|
Date |
User |
Action |
Args |
2008-06-03 13:06:10 | fma | set | spambayes_score: 0.046249 -> 0.04624895 recipients:
+ fma |
2008-06-03 13:06:09 | fma | set | spambayes_score: 0.046249 -> 0.046249 messageid: <1212498369.04.0.406397412231.issue3031@psf.upfronthosting.co.za> |
2008-06-03 13:06:07 | fma | link | issue3031 messages |
2008-06-03 13:06:05 | fma | create | |
|