[Pythonmac-SIG] [Pyobjc-dev] Py2app too complex?

Ronald Oussoren ronaldoussoren at mac.com
Sun Aug 1 13:59:48 CEST 2010


On 31 Jul, 2010, at 10:56, Virgil Dupras wrote:

> On Sat, Jul 31, 2010 at 10:26 AM, Ronald Oussoren
> <ronaldoussoren at mac.com> wrote:
>> 
>> On 31 Jul, 2010, at 3:09, Greg Ewing wrote:
>> 
>>> Virgil Dupras wrote:
>>>> Is it possible that py2app is a little too complex for what
>>>> it does?
>>> 
>>> I think a lot of the complexity of py2app and py2exe come
>>> from trying to automatically figure out what modules and
>>> libraries need to be included.
>> 
>> I object to calling py2app complex, the code base is fairly easy to understand.   Have you even looked at the code base?
>> 
>>> 
>>> I've been thinking for a while about creating something
>>> simpler that doesn't attempt any automatic module discovery
>>> at all. You would be required to construct a project file
>>> that explicitly lists all the required modules and libraries,
>>> including standard library modules.
>> 
>> That is not simpler, it just shifts the complexity to the user. It is better to shift the complexity away from the user, that way the user does not have to reinvent the weel.
>> 
>> Ronald
>> ------------------------------------------------------------------------------
>> The Palm PDK Hot Apps Program offers developers who use the
>> Plug-In Development Kit to bring their C/C++ apps to Palm for a share
>> of $1 Million in cash or HP Products. Visit us here for more details:
>> http://p.sf.net/sfu/dev2dev-palm
>> _______________________________________________
>> Pyobjc-dev mailing list
>> Pyobjc-dev at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev
>> 
>> 
> 
> I'm not sure I agree that no dependency finding would be a good thing.
> Importing a stdlib modules often imports tons of other ones you don't
> know about and manually figuring these dependencies out can be really
> tedious. However, I think that using modulegraph instead of the
> built-in modulefinder is a mistake. For one thing, modulegraph doesn't
> support relative imports, yet.

Adding is possible, and will be done. I'm working on that right now to be honest, and that code should be done by the end of the day (including unittests).

I don't agree that using modulefinder would be better. For one, modulefinder will never support setuptools trickery (see the zope.interface discussion on pythonmac-sig), while that can and will be added to modulegraph.

> Yeah, we could work on it, but why
> bother when modulefinder already does it? It's just more maintenance.
> I know modulegraph is supposed to be better, but I would *gladly* list
> my non-stdlib dependencies manually rather than pray that py2app finds
> them correctly. The way I work with py2app now is that whenever a
> dependency isn't found by py2app, I put an explicit import of it in my
> "main py file" in a section documented for being py2app workaround
> imports. It works, but I'm sure there's a more elegant way...

You can add an includes section to your setup.py file (see the includes argument on the command-line).

What would be better is to research why py2app doesn't find modules you use, or at least try to create a small sample that demonstrates the problem   I cannot fix issues if you don't report them.
> 
> I think distutils is supposed to let you list dependencies manually in
> the setup() call, but when I tried it I found it extremely
> non-working, at all. So yes, a reliable way to manually list
> dependencies would be a great thing.

setuptools has install_requires/setup_requires, but py2app does not have support for that yet (although setup_requires should ensure that the eggs your require are installed before py2app gets run).

You can also list includes/excludes in the py2app options dictionary:

	setup(
		options=dict(py2app=dict(
			include=['mymodule'],	
                ))
        )

Ronald

Ronald

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3567 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20100801/1eff66ab/attachment.bin>


More information about the Pythonmac-SIG mailing list