changeset 44378:bb58931d0c4f stable

setup: exclude the __index__ module from itself when generating This module is generated on Windows to hold all of the extension names and the help summaries, so that they are discoverable inside the py2exe zipfile. The problem is this file is generated by dumping the disabled list, and that list comes from walking the filesystem. So once an install from source into a virtualenv created this module, then next build from source from that virtualenv would also see __index__.py in the filesystem, and include it. Clearly that's wrong because this isn't a real extension, so just filter it from the list when generating it. The Mercurial installer was unaffected by this, but the TortoiseHg package was. In the final package, `hg help -v extensions` and the panel of extensions both showed it. Differential Revision: https://phab.mercurial-scm.org/D8142
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 24 Feb 2020 00:20:47 -0500
parents 1813f79017ac
children 92b7caf4cb9e
files setup.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/setup.py	Mon Feb 24 16:33:10 2020 -0500
+++ b/setup.py	Mon Feb 24 00:20:47 2020 -0500
@@ -665,7 +665,9 @@
         # here no extension enabled, disabled() lists up everything
         code = (
             'import pprint; from mercurial import extensions; '
-            'pprint.pprint(extensions.disabled())'
+            'ext = extensions.disabled();'
+            'ext.pop("__index__", None);'
+            'pprint.pprint(ext)'
         )
         returncode, out, err = runcmd(
             [sys.executable, '-c', code], localhgenv()