]> granicus.if.org Git - esp-idf/commitdiff
windows: Special check for some MSYS2 Python packages
authorAngus Gratton <angus@espressif.com>
Mon, 1 Oct 2018 03:59:14 +0000 (13:59 +1000)
committerAngus Gratton <gus@projectgus.com>
Mon, 1 Oct 2018 07:21:48 +0000 (17:21 +1000)
MSYS2 MINGW requires some particular MSYS2-specific packages.

Closes https://github.com/espressif/esp-idf/issues/2480
Closes https://github.com/espressif/esp-idf/issues/2474
Closes https://github.com/espressif/esp-idf/issues/2486

tools/check_python_dependencies.py

index 4f03d0650d50f9b989d3d671a1ebf9a634c7df83..37ba34de3d2d2874bac385eb5d3b569850ea4192 100755 (executable)
@@ -34,6 +34,27 @@ if __name__ == "__main__":
             default=idf_path + '/requirements.txt')
     args = parser.parse_args()
 
+    # Special case for MINGW32 Python, needs some packages
+    # via MSYS2 not via pip or system breaks...
+    if sys.platform == "win32" and \
+       os.environ.get("MSYSTEM", None) == "MINGW32" and \
+       "/mingw32/bin/python" in sys.executable:
+        failed = False
+        try:
+            import cryptography
+        except ImportError:
+            print("Please run the following command to install MSYS2's MINGW Python cryptography package:")
+            print("pacman -S mingw-w64-i686-python%d-cryptography" % (sys.version_info[0],))
+            failed = True
+        try:
+            import setuptools
+        except ImportError:
+            print("Please run the following command to install MSYS2's MINGW Python setuptools package:")
+            print("pacman -S mingw-w64-i686-python%d-setuptools" % (sys.version_info[0],))
+            failed = True
+        if failed:
+            sys.exit(1)
+
     not_satisfied = []
     with open(args.requirements) as f:
         for line in f: