On mar, 2008-12-30 at 18:47 +0100, Lorenzo Mancini wrote:
> Giovanni Bajo wrote:
> > On lun, 2008-12-22 at 18:20 +0100, Lorenzo Mancini wrote:
> >> Lorenzo Mancini wrote:
> >>> I'm attaching a pyinstaller hook for PyOpenGL which builds and improves 
> >>> on the one posted by Oscar a few days ago.  Namely:
> >> ...and thinking a little more about it, it doesn't make really sense to 
> >> RuntimeError when PyOpenGL version doesn't match; if it's a <=3.0.0b6 
> >> PyOpenGL it's not going to work anyway, and if it's an older 2.x 
> >> version, those used to work as-is under pyinstaller.
> >>
> >> I'm attaching the updated version.
> > 
> > The version check is useless as well: if you have an older version (eg:
> > v2) those modules will not exist and this does not do any harm (except
> > false positives among missing modules). 
> 
> Sounds reasonable.  I've removed the version check, see 
> add-opengl-hook.patch .

This is fine, commit it.

> > But you should never import a module within its hook, so this is a
> > non-starter.
> 
> Could pyinstaller issue a warning if such a thing happens?  See 
> print-warning-if-importing-hook-module.patch .

Uhm... thinking of it, I don't recall right now *why* a hook module
shouldn't import the third party module it is handling. I do remember
that it was important for some reason (otherwise, hook-xml.py that is
there since day #1 wouldn't go through the hoops instead of simply
importing it), but I can't recall why.

In doubt, I would prefer if you change this warning into an internal
error, raising an exception like ImportError.

> > If you look at hook-xml, you will see that it executes a
> > subprocess to check the pyxml version: that's the way to do it.
> 
> I extracted that trick in a separate helper function exec_statement 
> (extract-external-interpreter-spawning.patch), so that it can be used by 
> other hooks.
> 
> Existing hook-sqlalchemy.py used to import sqlalchemy, so I rewrote it 
> using exec_statement (use-exec_statement-for-sqlalchemy-hook.patch).

This is also fine, please commit it.
-- 
Giovanni Bajo
Develer S.r.l.
http://www.develer.com



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/PyInstaller?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to