Distutils confusion - please give me a hand
Hi, I have been okay with distutils until my tree got a little bigger, now I am getting errors like: distutils.errors.DistutilsFileError: can't copy 'fontypythonmodules/things/': doesn't exist or not a regular file I confess to being absolutely lost here. I have a few sub-directories inside my package that contain help stuff and locale stuff which I want distutils to include and install. It always worked before, until I invented the help/common/en directory and now it just won't work any more. Here's my tree (warning, monotype font needed): trunk:$ tree . |-- COPYING |-- MANIFEST.in |-- PKG-INFO |-- README |-- fontypython |-- fontypythonmodules | |-- __init__.py | |-- cli.py | |-- dialogues.py | |-- fontcontrol.py | |-- fontybugs.py | |-- fpsys.py | |-- fpversion.py | |-- help | | |-- README | | |-- common | | | |-- README | | | |-- fp1.png.cr.png | | | |-- fp2.png.cr.png | | | |-- fp3.png.cr.png | | | |-- fp4.png.cr.png | | | |-- fp5.png.cr.png | | | |-- fp6.png.cr.png | | | |-- fp7.png.cr.png | | | |-- fp8.png.cr.png | | | |-- fp_already_in_x.png | | | |-- fp_removing_a_font-nq8.png | | | |-- fp_removing_a_font.png | | | |-- fp_ticking.png | | | `-- logo_dec_2007.png | | `-- en | | |-- README | | |-- fp_1to8.png | | |-- fp_pog_icons.cr.png | | `-- help.html | |-- i18n.py | |-- locale | | `-- fr | | `-- LC_MESSAGES | | `-- all.mo | |-- pathcontrol.py | |-- pofiles | | |-- README | | |-- fontypython_translation_template.pot | | `-- fr_all.dec30.pot | |-- pubsub.py | |-- start.py | |-- strings.py | |-- things | | |-- README | | |-- aboutfplogo.png | | |-- cross.png | | |-- fplogo.png | | |-- icon_source_16x16.png | | |-- icon_source_folder_16x16.png | | |-- icon_source_pog_16x16.png | | |-- icon_target_16x16.png | | |-- pog16x16.installed.png | | |-- pog16x16.png | | |-- pog16x16.target.png | | `-- tick.png | `-- wxgui.py |-- fp `-- setup.py Here's my MANIFEST.in include fontypython fp README COPYING recursive-include fontypythonmodules/pofiles * recursive-include fontypythonmodules/things * recursive-include fontypythonmodules/help * recursive-include fontypythonmodules/locale * And here's my basic setup.py, stripped down somewhat: files = ["things/*", "help/*", "help/common/*.*", "help/en/*", "pofiles/*", "locale/fr/LC_MESSAGES/*"] setup(name = "fontypython", packages = ['fontypythonmodules'], package_data = {'fontypythonmodules' : files}, scripts = ["fontypython", "fp"], ....) Weirdly, the path to locale/fr/etc... works just fine. things/* also worked (before I added help). It does not like help/common for some reason I cannot fathom. I have checked case and permissions, but all seems in order. Can anyone point me in the right direction? \d
Donn Ingle
I confess to being absolutely lost here. I have a few sub-directories inside my package that contain help stuff and locale stuff which I want distutils to include and install. It always worked before, until I invented the help/common/en directory and now it just won't work any more.
While waiting, use your time constructively with the time-honoured debugging technique of "make the simplest example that shows the problem". In other words, try implementing a tiny project with distutils, and gradually work toward your problematic one, running distutils commands each time you make a change, until it produces the same problematic behaviour. Then, try simplifying it by removing things that don't seem to be related to the problem, until the problem stops happening. Repeat until you have the simplest implementation of the problem you can devise that you can't make simpler without losing the unexpected behaviour. Then, post that problem implementation here, with a description that will no doubt be improved by the above process. -- \ "Don't be afraid of missing opportunities. Behind every failure | `\ is an opportunity somebody wishes they had missed." -- Jane | _o__) Wagner, via Lily Tomlin | Ben Finney
While waiting, use your time constructively with the time-honoured debugging technique of "make the simplest example that shows the problem". I'd thought my post was mostly doing that already - not runnable, but not vague.
Do you mean, given it's contents, that the error I get is an unusual one? If so, then I'd have to hack an example. If not, then I'm hoping for some quick expert advice for 'housing' directory trees full of data under the package or Distribution-root directories. I have spent too many hours trying to get distutils to 'see' my tree and I have actually run out of dev-time for my project now. \d
Donn Ingle wrote:
While waiting, use your time constructively with the time-honoured debugging technique of "make the simplest example that shows the problem". I'd thought my post was mostly doing that already - not runnable, but not vague.
Do you mean, given it's contents, that the error I get is an unusual one? If so, then I'd have to hack an example. If not, then I'm hoping for some quick expert advice for 'housing' directory trees full of data under the package or Distribution-root directories.
I have spent too many hours trying to get distutils to 'see' my tree and I have actually run out of dev-time for my project now.
wxPython has some examples of specifying in-package data files that you can probably build upon. See where DATA_FILES is built up, the wx_smart_install_data command class, and the find_data_files function. http://svn.wxwidgets.org/viewvc/wx/wxPython/branches/WX_2_8_BRANCH/ Look at both setup.py and config.py. -- Robin Dunn Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
FWIW, I have updated a tutorial I did on the Python wiki to include the solution (thanks Robin) to this problem: http://wiki.python.org/moin/DistUtilsTutorial \d
participants (3)
-
Ben Finney
-
Donn Ingle
-
Robin Dunn