D6067: inno: stop shipping pywin32

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Sun Mar 3 18:52:30 EST 2019


indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Ancient versions of Mercurial relied on pywin32 and I suspect
  that's why we have this dependency.
  
  We also ship the "keyring" package, which has a dependency
  on "pywin32-ctypes" (providing the "win32ctypes" package).
  This is a stripped down version of pywin32 that doesn't have
  as many dependencies.
  
  Since we don't have a dependency on pywin32 and since pywin32
  is a bit annoying to package, let's get rid of it.
  
  With this change, py2exe no longers picks up DLL dependencies
  on various UCRT DLLs (because we no longer have a .pyd file
  beloning to pywin32 which was pulling them in). So, we were
  able to remove code in support of the UCRT DLLs.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  contrib/packaging/inno-installer/build.py
  contrib/packaging/inno-installer/readme.rst
  contrib/packaging/inno-installer/requirements.txt
  contrib/packaging/inno-installer/requirements.txt.in
  setup.py

CHANGE DETAILS

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1266,29 +1266,29 @@
 
     try:
         import dulwich
+        py2exepackages.append('dulwich')
         dulwich.__version__
-        py2exepackages.append('dulwich')
     except ImportError:
         pass
 
     try:
         import keyring
+        py2exepackages.append('keyring')
         keyring.util
-        py2exepackages.append('keyring')
     except ImportError:
         pass
 
     try:
         import pygments
+        py2exepackages.append('pygments')
         pygments.__version__
-        py2exepackages.append('pygments')
     except ImportError:
         pass
 
     try:
-        import pywintypes
-        pywintypes.TRUE
-        py2exepackages.append('pywintypes')
+        import win32ctypes
+        win32ctypes.__version__
+        py2exepackages.append('win32ctypes')
     except ImportError:
         pass
 
@@ -1372,14 +1372,6 @@
       options={
           'py2exe': {
               'packages': py2exepackages,
-              'dll_excludes': [
-                  'api-ms-win-core-apiquery-l1-1-0.dll',
-                  'api-ms-win-core-delayload-l1-1-0.dll',
-                  'api-ms-win-core-delayload-l1-1-1.dll',
-                  'api-ms-win-core-heap-l2-1-0.dll',
-                  'api-ms-win-core-libraryloader-l1-2-0.dll',
-                  'api-ms-win-core-registry-l1-1-0.dll',
-              ]
           },
           'bdist_mpkg': {
               'zipdist': False,
diff --git a/contrib/packaging/inno-installer/requirements.txt.in b/contrib/packaging/inno-installer/requirements.txt.in
--- a/contrib/packaging/inno-installer/requirements.txt.in
+++ b/contrib/packaging/inno-installer/requirements.txt.in
@@ -2,4 +2,3 @@
 dulwich
 keyring
 pygments
-pywin32
diff --git a/contrib/packaging/inno-installer/requirements.txt b/contrib/packaging/inno-installer/requirements.txt
--- a/contrib/packaging/inno-installer/requirements.txt
+++ b/contrib/packaging/inno-installer/requirements.txt
@@ -32,15 +32,6 @@
     --hash=sha256:24ffc3b341d457d48e8922352130cf2644024a4ff09762a2261fd34c36ee5942 \
     --hash=sha256:9dc2d991b3479cc2df15930958b674a48a227d5361d413827a4cfd0b5876fc98 \
     # via keyring
-pywin32==224 \
-    --hash=sha256:22e218832a54ed206452c8f3ca9eff07ef327f8e597569a4c2828be5eaa09a77 \
-    --hash=sha256:32b37abafbfeddb0fe718008d6aada5a71efa2874f068bee1f9e703983dcc49a \
-    --hash=sha256:35451edb44162d2f603b5b18bd427bc88fcbc74849eaa7a7e7cfe0f507e5c0c8 \
-    --hash=sha256:4eda2e1e50faa706ff8226195b84fbcbd542b08c842a9b15e303589f85bfb41c \
-    --hash=sha256:5f265d72588806e134c8e1ede8561739071626ea4cc25c12d526aa7b82416ae5 \
-    --hash=sha256:6852ceac5fdd7a146b570655c37d9eacd520ed1eaeec051ff41c6fc94243d8bf \
-    --hash=sha256:6dbc4219fe45ece6a0cc6baafe0105604fdee551b5e876dc475d3955b77190ec \
-    --hash=sha256:9bd07746ce7f2198021a9fa187fa80df7b221ec5e4c234ab6f00ea355a3baf99
 urllib3==1.24.1 \
     --hash=sha256:61bf29cada3fc2fbefad4fdf059ea4bd1b4a86d2b6d15e1c7c0b582b9752fe39 \
     --hash=sha256:de9529817c93f27c8ccbfead6985011db27bd0ddfcdb2d86f3f663385c6a9c22 \
diff --git a/contrib/packaging/inno-installer/readme.rst b/contrib/packaging/inno-installer/readme.rst
--- a/contrib/packaging/inno-installer/readme.rst
+++ b/contrib/packaging/inno-installer/readme.rst
@@ -8,9 +8,6 @@
 * Python 2.7 (download from https://www.python.org/downloads/)
 * Microsoft Visual C++ Compiler for Python 2.7
   (https://www.microsoft.com/en-us/download/details.aspx?id=44266)
-* Windows 10 SDK (download from
-  https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk
-  or install via a modern version of Visual Studio)
 * Inno Setup (http://jrsoftware.org/isdl.php) version 5.4 or newer.
   Be sure to install the optional Inno Setup Preprocessor feature,
   which is required.
diff --git a/contrib/packaging/inno-installer/build.py b/contrib/packaging/inno-installer/build.py
--- a/contrib/packaging/inno-installer/build.py
+++ b/contrib/packaging/inno-installer/build.py
@@ -121,20 +121,6 @@
     if py_version != 2:
         raise Exception('Only Python 2 is currently supported')
 
-    # Some extensions may require DLLs from the Universal C Runtime (UCRT).
-    # These are typically not in PATH and py2exe will have trouble finding
-    # them. We find the Windows 10 SDK and the UCRT files within.
-    sdk_path = (pathlib.Path(os.environ['ProgramFiles(x86)']) /
-                'Windows Kits' / '10' / 'Redist' / 'ucrt' / 'DLLs')
-
-    if vc_x64:
-        sdk_path = sdk_path / 'x64'
-    else:
-        sdk_path = sdk_path / 'x86'
-
-    if not sdk_path.is_dir():
-        raise Exception('UCRT files could not be found at %s' % sdk_path)
-
     build_dir.mkdir(exist_ok=True)
 
     gettext_pkg = download_entry(DOWNLOADS['gettext'], build_dir)
@@ -193,11 +179,6 @@
                            env=env,
                            check=True)
 
-        if str(sdk_path) not in os.environ['PATH'].split(os.pathsep):
-            print('adding %s to PATH' % sdk_path)
-            env['PATH'] = '%s%s%s' % (
-                os.environ['PATH'], os.pathsep, str(sdk_path))
-
         # Register location of msgfmt and other binaries.
         env['PATH'] = '%s%s%s' % (
             env['PATH'], os.pathsep, str(gettext_root / 'bin'))



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


More information about the Mercurial-devel mailing list