[Pythonmac-SIG] I published a couple of improvements to py2app

Virgil Dupras hsoft at hardcoded.net
Fri Aug 20 12:44:04 CEST 2010


On Fri, Aug 20, 2010 at 7:38 AM, Ronald Oussoren <ronaldoussoren at mac.com> wrote:
>
> On 19 Aug, 2010, at 20:04, Virgil Dupras wrote:
>
>> On Thu, Aug 19, 2010 at 12:02 PM, Ronald Oussoren
>> <ronaldoussoren at mac.com> wrote:
>>>
>>> Option to use the built-in modulefinder instead of modulegraph: I was
>>> getting tired of having to write workaround imports to modulegraph
>>> (which doesn't like relative imports very well, even the latest
>>> version) and I didn't want to dig in modulegraph itself, so as an
>>> experiment, I added a "--use-modulefinder" option to py2app. I haven't
>>> tested it much, but so far, I'm able to build one of my apps *without*
>>> the workarounds I had for modulegraph, so it my case, it works better.
>>>
>>>
>>> This won't get merged, I'd much rather fix modulegraph. If that doesn't work
>>> out for some reason modulegraph should get ripped out, choosing between the
>>> two is unnecessary complexity for both the maintainers and users of py2app.
>>> One of the things on my todolist for py2app and related modules is to add
>>> proper tests, which should make it easier to ensure that bugs get fixed and
>>> stay fixed.
>>> And then there are the mac-related bugs in CPython itself, which also need
>>> my attention.
>>> Ronald
>>>
>>
>> Sure. I didn't implement this in the hope that it was merged, it was
>> more of a way to experiment how modulegraph and modulefinder compared
>> when I ran it on my apps.
>
> There is something that would help trying to fix the problem your having with modulegraph: Create simple programs that reproduce the problem(s).
>
> Ronald
>
>

I reproduced the problem and created a package reproducing it. I
thought it would be hard, but it's really easy: I have a main script
and a package 'pkg' containing submodules 'a' and 'b'. 'b' does
nothing, 'a' import 'b' with 'from . import b'. the mainscript does
'from pkg import a'. Modulefinder finds both 'a' and 'b'. Modulegraph
only finds 'a'. I included a 'run.py' script in the package that runs
them both and print the report:

MODULEFINDER

  Name                      File
  ----                      ----
m __main__                  main_script.py
P pkg
/Users/hsoft/Desktop/modulegraph_test/pkg/__init__.py
m pkg.a                     /Users/hsoft/Desktop/modulegraph_test/pkg/a.py
m pkg.b                     /Users/hsoft/Desktop/modulegraph_test/pkg/b.py
MODULEGRAPH

Class           Name                      File
----            ----                      ----
Script          main_script.py
/Users/hsoft/Desktop/modulegraph_test/main_script.py
Package         pkg
/Users/hsoft/Desktop/modulegraph_test/pkg/__init__.py
SourceModule    pkg.a

Regards,
Virgil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: modulegraph_test.zip
Type: application/zip
Size: 2982 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20100820/0c87387c/attachment.zip>


More information about the Pythonmac-SIG mailing list