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

login
register
mail settings
Submitter Yuya Nishihara
Date July 27, 2017, 2:35 p.m.
Message ID <0f4e740ea0e009615758.1501166104@mimosa>
Download mbox | patch
Permalink /patch/22566/
State Accepted
Headers show

Comments

Yuya Nishihara - July 27, 2017, 2:35 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1500558460 -32400
#      Thu Jul 20 22:47:40 2017 +0900
# Branch stable
# Node ID 0f4e740ea0e009615758fe26de31c14ae9466d34
# Parent  26e41875da7be30b96b904ab3f52615cd19029b5
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.

Patch

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -937,7 +937,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',