Re: Exclude certain files from py2app built apps

Ronald Oussoren <[email protected]>
Newsgroups gmane.comp.python.apple
Message-ID <[email protected]>
On 13 May, 2013, at 18:55, Olivier Cornu <[email protected]> wrote:

> Thanks for your quick reply. :-=
> 
> 
> On Mon, May 13, 2013 at 11:10 AM, Ronald Oussoren <[email protected]> wrote:
> 
> py2app does not use the MANIFEST file, that file is meant to be used with the sdist command.
> 
> Well, on my machine (Linux/Python-2.7), it seems bdist, bdist_rpm and bdist_egg (among others) do generate an egg-info directory following MANIFEST.in directives, just like sdist. Which appears to contradict your point; Or did i miss something?

But does bdist_egg actually include those files (I'm too lazy to check this right now)? 

>  
> > We've also tried defining data_files more restrictively so that only desired files figures in it. The whole data/ folder gets included nonetheless.
> 
> Sorry, i mixed things up: py2app does respect data_files. This problem happened using distutils/setuptools, to build other package on other platforms: defining data_files wasn't enough to get them included, they had to appear in a MANIFEST(.in) as well.
> As i'm looking for a unified way of specifying included files across building methods i discarded this one, but it wasn't because of py2app.
>  
> > So far, the only solution we've found to this problem is to remove undesired files from the .app folder using a post-processing shell script (i.e. running after py2app). A rather inelegant hack.
> 
> py2app currently doesn't have a way to filter which parts of a data folder gets included in the application bundle (that is, when you tell py2app to include 'data' you cannot tell it to exclude 'data/windows.dat').
> 
> Alright, no way to exclude files. I guess we'll just go "positive" and specify only needed ones in data_files then -- even though it's going to be more verbose a declaration. ;-)
> It does work with py2app, although as mentioned above, it does not seem to work with other tools. Is it just me day dreaming about a single mechanism to include files among different setup.py commands, or is there one that i just can't put my hand on?
> Am i the only one surprised that i need to rely on different mechanisms to tell setup.py what to include, just because the sub-command is different?

The goals of the various command's are different.  In particular, your MANIFEST.in will normally include files that aren't needed at runtime, such as the ReadMe file, other documentation and examples. Those should be included in the sdist, and possibly be installed, but aren't needed in an application bundle (or a windows executable created with py2app).

Distutils, and by extension setuptools, does not really have a formal description of its behavior the behavior is more or less an accumulation of years of development by different people that do not necessarily have deep knowlegde of distutils.  And that's just the core project, external tools like py2app are a whole different story (and I write that as the py2app maintainer).

In the long run distutils will likely be replaced by better tools, the folks over on the distutils-sig are working on that. The first steps, that are making good progres, and to create a binary distribution format ("wheels") as the interface between a build-tool (like distutils) and an installation tool (like easy_install or pip), and a well defined installation format.  Followup steps will define other interfaces (such as a way the installer can detect which build tool it should use to convert an sdist into a binary distribution for installation).  With some luck Python 3.4 will include at least support for the wheel format and a basic installer.

Ronald




> ___
> ɹǝıʌıןo
> 

_______________________________________________
Pythonmac-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.