[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] BUG: required modules not raising error when failing to import was Re: [pygame] Surfarray.array_alpha() bugfix, py2exe/py2app segfault



Hi,

there are a few template setup scripts for py2exe and pyapp... However
both of those have changed over the years, and it seems the scripts
keep failing.

The 'skellington' is such a project, and it gets updated every now and then.

I think we need to approach it from both directions... both making
those tools work out of the box, and also providing an application
template.

Trimming the fat from the bundled application is a tedious process, as
these app makers often pull in all sorts of stuff that isn't needed.
They try and use dependency generators and other things to do their
job, but often get things wrong -- since automatically figuring out
python dependencies is a very hard task.  Adding some code to trim
unneeded stuff would be useful.  As an example, often tk can be
included even though hardly anything is.  However each time one
package changes (or python version changes) different files need to be
cut away.  I don't know if we can solve this problem really.

We definitely should try and make sure skellington, py2exe, and pyapp
work with each pygame release.

Where is skellington?  I'm not really sure... it appears for each
pyweek -- and often people post patches.  However I'm not sure where
its home is...  I think Richard Jones or Simon Wittber probably know
this.

Maybe even making skellington a package of pygame?  So we could have a
function like 'create_exe' etc.

Contributing to it so that it's more polished is another option.



cheers,



On Thu, Feb 5, 2009 at 5:32 PM, <mva@xxxxxxxxxxxx> wrote:
>
> Lenard Lindstrom <len-l@xxxxxxxxx>:
>
>> Hi Marcus,
>>
>> Fortunately, from what I can gather, py2exe doesn't actually need a
>> module imported to include it. All it looks for are import statements
>> in the source. It's not necessary for the statement to actually
>> execute. You can see at the bottom of __init__.py:
>>
>> def packager_imports():
>>   """
>>   Some additional things that py2app/py2exe will want to see
>>   """
>>   import Numeric
>>   import numpy
>>   import OpenGL.GL
>>   import pygame.macosx
>>   import pygame.mac_scrap
>
> So we have to take care that e.g. submodules of numpy, Numeric and co. are
> also imported correctly within that function, in case they are not by their
> respective package?
>
> What about the following scenario:
> John User uses pygame, but not OpenGL and Numeric and no pygame modules,
> which would require them. He has both installed though. What would py2exe do?
> Package them up, although they do not need to be distributed? If so, that's
> a waste of resources and clearly a misbehaviour from the user perspective in
> my opinion.
>
> Regards
> Marcus
>
>
>
>