D6189: py2exe: add workaround to allow bundling of hgext3rd.* extensions

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Wed Apr 3 19:08:05 EDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG399ed3e86a49: py2exe: add workaround to allow bundling of hgext3rd.* extensions (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6189?vs=14639&id=14645

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

AFFECTED FILES
  contrib/packaging/hgpackaging/py2exe.py
  setup.py

CHANGE DETAILS

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -975,6 +975,12 @@
     packages.extend(['mercurial.thirdparty.concurrent',
                      'mercurial.thirdparty.concurrent.futures'])
 
+if 'HG_PY2EXE_EXTRA_INSTALL_PACKAGES' in os.environ:
+    # py2exe can't cope with namespace packages very well, so we have to
+    # install any hgext3rd.* extensions that we want in the final py2exe
+    # image here. This is gross, but you gotta do what you gotta do.
+    packages.extend(os.environ['HG_PY2EXE_EXTRA_INSTALL_PACKAGES'].split(' '))
+
 common_depends = ['mercurial/bitmanipulation.h',
                   'mercurial/compat.h',
                   'mercurial/cext/util.h']
diff --git a/contrib/packaging/hgpackaging/py2exe.py b/contrib/packaging/hgpackaging/py2exe.py
--- a/contrib/packaging/hgpackaging/py2exe.py
+++ b/contrib/packaging/hgpackaging/py2exe.py
@@ -118,6 +118,10 @@
 
     if extra_packages:
         env['HG_PY2EXE_EXTRA_PACKAGES'] = ' '.join(sorted(extra_packages))
+        hgext3rd_extras = sorted(
+            e for e in extra_packages if e.startswith('hgext3rd.'))
+        if hgext3rd_extras:
+            env['HG_PY2EXE_EXTRA_INSTALL_PACKAGES'] = ' '.join(hgext3rd_extras)
     if extra_excludes:
         env['HG_PY2EXE_EXTRA_EXCLUDES'] = ' '.join(sorted(extra_excludes))
     if extra_dll_excludes:



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


More information about the Mercurial-devel mailing list