[PATCH 2 of 2 STABLE] setup: forcibly include cext/pure packages in py2exe (issue5625)

Yuya Nishihara yuya at tcha.org
Thu Jul 20 10:39:53 EDT 2017


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1500558460 -32400
#      Thu Jul 20 22:47:40 2017 +0900
# Branch stable
# Node ID d5bb7d09db154036eaf1173c5445356218b8291e
# Parent  3f8f39ef616024ac0722c701aeae9105a52728fa
setup: forcibly include cext/pure packages in py2exe (issue5625)

Since these modules are implicitly imported by policy.importmod(), py2exe
can't track them statically. cffi modules are excluded for now because they
wouldn't be useful in frozen (i.e. CPython) environment.

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -889,7 +889,12 @@ setup(name='mercurial',
       package_data=packagedata,
       cmdclass=cmdclass,
       distclass=hgdist,
-      options={'py2exe': {'packages': ['hgdemandimport', 'hgext', 'email']},
+      options={'py2exe': {'packages': ['hgdemandimport', 'hgext', 'email',
+                                       # implicitly imported per module policy
+                                       # (cffi wouldn't be used as a frozen exe)
+                                       'mercurial.cext',
+                                       #'mercurial.cffi',
+                                       'mercurial.pure']},
                'bdist_mpkg': {'zipdist': False,
                               'license': 'COPYING',
                               'readme': 'contrib/macosx/Readme.html',


More information about the Mercurial-devel mailing list