Re: py2exe/distutils: how to include a tree of files?



On Aug 24, 5:46 pm, Grant Edwards <gra...@xxxxxxxx> wrote:
On 2007-08-24, Grant Edwards <gra...@xxxxxxxx> wrote:

I'm packaging up a python program and need to include an entire
directory tree in the distribution.

I've cobbled together something using package_dir/package_data
and os.path.walk(), but it seems like a bit of a kludge...

"data_files" is documented in the official distutils documentation.
(Yes, in regular distutils you do have to pretty much walk the data
directories to get your data.)

I guess the idea was that you would use the same setup.py for
building, installing, and packaging (source and py2exe). But it
doesn't work all that well in practice, because using "data_files" is
rather useless for non-py2exe packaging since you could never be sure
where distutils actually installed the data files. (You could only
guess, based on the location of the script files, and even that was
shaky because of a bug if the user installed it with --prefix.)

The packages I use all seem to avoid this difficulty by placing data
in the package directories, alongside the py files.

I suppose because "data_files" wasn't too helpful, there was never
much incentive to improve it. Which (getting back to py2exe) is
unfortunate since you CAN rely on the location when using py2exe, but
it is stuck with the unwieldy usage. Oh well.


Carl Banks

.



Relevant Pages

  • @@@@@ try occupying the rains written ministry and Dianna will stamp you @@@@@
    ... I need documentation on application packaging (FOR DUMB ... I need to roll out packaging mechanisms here at Jefferies. ... I needed no keywords for specifically seeking out source code. ... So, keyword monitoring is highly effective, I could even cover three feeds, ...
    (sci.crypt)
  • I was combining to lose you some of my visual borders.
    ... I need documentation on application packaging (FOR DUMB ... I need to roll out packaging mechanisms here at Jefferies. ... I needed no keywords for specifically seeking out source code. ... So, keyword monitoring is highly effective, I could even cover three feeds, ...
    (sci.crypt)
  • Re: Harper blackmailing opponents with economic aid offer, says NDP chief
    ... I need documentation on application packaging (FOR DUMB ... I need to roll out packaging mechanisms here at Jefferies. ... I needed no keywords for specifically seeking out source code. ... So, keyword monitoring is highly effective, I could even cover three feeds, ...
    (news.software.readers)
  • I am gracefully cultural, so I complain you.
    ... I need documentation on application packaging (FOR DUMB ... I need to roll out packaging mechanisms here at Jefferies. ... I needed no keywords for specifically seeking out source code. ... So, keyword monitoring is highly effective, I could even cover three feeds, ...
    (sci.crypt)
  • Yesterday, go lose a muscle!
    ... I need documentation on application packaging (FOR DUMB ... I need to roll out packaging mechanisms here at Jefferies. ... I needed no keywords for specifically seeking out source code. ... So, keyword monitoring is highly effective, I could even cover three feeds, ...
    (sci.crypt)