[PATCH] Force pygments package to be loaded in py2exe
Matt Mackall
mpm at selenic.com
Tue Jan 27 22:41:00 UTC 2009
On Tue, 2009-01-27 at 23:35 +0100, Pascal Quantin wrote:
> Matt Mackall a écrit :
> > On Tue, 2009-01-27 at 23:18 +0100, Pascal Quantin wrote:
> >
> >> Matt Mackall a écrit :
> >>
> >>> On Tue, 2009-01-27 at 22:42 +0100, Pascal Quantin wrote:
> >>>
> >>>
> >>>> # HG changeset patch
> >>>> # User Pascal Quantin <pascal.quantin at gmail.com>
> >>>> # Date 1233089606 -3600
> >>>> # Node ID 87d4115806b006f9080eb5c36958274feb023ac9
> >>>> # Parent 97b55cce3100d3b408cda75b96dabdd5be92dd6a
> >>>> Force pygments package to be loaded in py2exe
> >>>>
> >>>> Like with email package, the pygments package is not fully loaded by py2exe due to Python2.5 dynamic imports which are not found by modulefinder. This breaks the highlight extension.
> >>>> -> Force the pygments package to be included if installed so that the dynamic imports work as expected.
> >>>>
> >>>>
> >>> Dunno. The difference is that the packages in email are standard Python
> >>> bits, where pygments is not.
> >>>
> >>> I don't think we want builds to quietly change based on what third-party
> >>> packages happen to be installed. We certainly don't do this on the Unix
> >>> side of the fence.
> >>>
> >>> Is it not possible to download and install pygments separately?
> >>>
> >>>
> >>>
> >> Hi,
> >>
> >> in fact my title is wrong and should be read "Force pygments package to
> >> be loaded in py2exe if present".
> >> As pygments is used by the highlight extension bundled with mercurial,
> >> the idea is to force explicitly its inclusion in py2exe if pygments is
> >> present in python installation path.
> >> Without this patch, trying to use highlight extension after compiling a
> >> hg.exe with py2exe and pygments installed leads to a "error: no module
> >> named text" failure.
> >>
> >
> > Yes, I understood all that the first time around.
> >
> >
> Sorry, English is not my primary language so I'm not sure I understood
> what you meant.
> AFAIK, for the windows installer all python packages must be installed
> before compiling the executable with py2exe
I question whether this is true, but I'm not in a position to test it.
I'm pretty sure it's possible to point at external Python modules, even
with no standalone Python installed. I believe Bill Barry is developing
his attic extension this way.
> and with current setup.py
> this fails even when pygments is installed.
That's ok, provided the end user can install pygments themselves (even
if that means installing Python). We don't ship pygments with Mercurial
builds on Unix either.
--
http://selenic.com : development and support for Mercurial and Linux
More information about the Mercurial-devel
mailing list