Message200298
On Python 2.7 and 3.3, if the package_data glob happens to match a directory, it will trigger this error during build:
error: can't copy '<package>/<dirname>': doesn't exist or not a regular file
It seems that package_data is not very smart about filtering out directories, and assumes every name matched in the glob is a file. This is particularly inconvenient when one has a directory structure of package data. Consider:
package_data={
'bug_pkg': (
[
'html/*.*',
'html/something-1.0/*.*',
]
),
},
with a directory structure of:
.
│ setup.py
│
└───bug_pkg
│ __init__.py
│
└───html
│ index.html
│
└───something-1.0
index.dat
Since 'html/*.*' matches 'something-1.0', distutils assumes something-1.0 is a file and tries to copy it and fails with:
error: can't copy 'bug_pkg/html/something-1.0': doesn't exist or not a regular file
I believe distutils should be filtering out folders from package_data. In the past, users (including myself) have worked around the issue by using '*.*' to match only files, but that's a poor heuristic is the above example demonstrates.
This issue was encountered when using sphinx-bootstrap-theme, which adds directories to sphinx HTML docs with directories like 'bootstrap-3.0.0', which are difficult to not match in a glob.
Is there any reason why globs specified in package_data should not exclude all directories? |
|
Date |
User |
Action |
Args |
2013-10-18 19:11:00 | jaraco | set | recipients:
+ jaraco, tarek, eric.araujo |
2013-10-18 19:11:00 | jaraco | set | messageid: <1382123460.13.0.176528626985.issue19286@psf.upfronthosting.co.za> |
2013-10-18 19:11:00 | jaraco | link | issue19286 messages |
2013-10-18 19:10:59 | jaraco | create | |
|