D6064: setup: include additional packages in py2exe distribution

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Tue Mar 5 10:24:21 EST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGed35057421ae: setup: include additional packages in py2exe distribution (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6064?vs=14329&id=14366

REVISION DETAIL
  https://phab.mercurial-scm.org/D6064

AFFECTED FILES
  setup.py

CHANGE DETAILS

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1240,8 +1240,20 @@
 
 extra = {}
 
+py2exepackages = [
+    'hgdemandimport',
+    'hgext',
+    'email',
+    # implicitly imported per module policy
+    # (cffi wouldn't be used as a frozen exe)
+    'mercurial.cext',
+    #'mercurial.cffi',
+    'mercurial.pure',
+]
+
 if issetuptools:
     extra['python_requires'] = supportedpy
+
 if py2exeloaded:
     extra['console'] = [
         {'script':'hg',
@@ -1252,6 +1264,34 @@
     # put dlls in sub directory so that they won't pollute PATH
     extra['zipfile'] = 'lib/library.zip'
 
+    try:
+        import dulwich
+        dulwich.__version__
+        py2exepackages.append('dulwich')
+    except ImportError:
+        pass
+
+    try:
+        import keyring
+        keyring.util
+        py2exepackages.append('keyring')
+    except ImportError:
+        pass
+
+    try:
+        import pygments
+        pygments.__version__
+        py2exepackages.append('pygments')
+    except ImportError:
+        pass
+
+    try:
+        import pywintypes
+        pywintypes.TRUE
+        py2exepackages.append('pywintypes')
+    except ImportError:
+        pass
+
 if os.name == 'nt':
     # Windows binary file versions for exe/dll files must have the
     # form W.X.Y.Z, where W,X,Y,Z are numbers in the range 0..65535
@@ -1331,16 +1371,7 @@
       distclass=hgdist,
       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',
-              ],
+              'packages': py2exepackages,
           },
           'bdist_mpkg': {
               'zipdist': False,



To: indygreg, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list