Re: py2exe/distutils: how to include a tree of files?
- From: Carl Banks <pavlovevidence@xxxxxxxxx>
- Date: Fri, 24 Aug 2007 17:04:12 -0700
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
.
- Follow-Ups:
- Re: py2exe/distutils: how to include a tree of files?
- From: Grant Edwards
- Re: py2exe/distutils: how to include a tree of files?
- References:
- py2exe/distutils: how to include a tree of files?
- From: Grant Edwards
- Re: py2exe/distutils: how to include a tree of files?
- From: Grant Edwards
- py2exe/distutils: how to include a tree of files?
- Prev by Date: Re: Problem w/ Tkinter
- Next by Date: Re: Parser Generator?
- Previous by thread: Re: py2exe/distutils: how to include a tree of files?
- Next by thread: Re: py2exe/distutils: how to include a tree of files?
- Index(es):
Relevant Pages
|
|