diff setup.py @ 583:4e61df27b4e1

Put the ".egg-info" check into a common location
author Franz Glasner <fzglas.hg@dom66.de>
date Sun, 09 Jan 2022 13:26:56 +0100
parents 0467b3ae34ea
children 233bd8bbda28
line wrap: on
line diff
--- a/setup.py	Sun Jan 09 12:47:56 2022 +0100
+++ b/setup.py	Sun Jan 09 13:26:56 2022 +0100
@@ -61,18 +61,17 @@
     del sys.argv[wcp_idx]
 
 
-if wcp_idx is None:
+#
+# Otherwise some cached package_data would be used.
+# But our package data differs between "standard" builds and
+# builds with "--windows-cross-pack".
+#
 
-    #
-    # Otherwise some cached package_data would be used.
-    # But our package data differs between "standard" builds and
-    # builds with "--windows-cross-pack".
-    #
+if os.path.isdir(PROJECT_NAME + ".egg-info"):
+    raise RuntimeError(
+        "please remove %s.egg-info before" % (PROJECT_NAME,))
 
-    if os.path.isdir(PROJECT_NAME + ".egg-info"):
-        raise RuntimeError(
-            "please remove %s.egg-info before" % (PROJECT_NAME,))
-
+if wcp_idx is None:
     #
     # Handle the optinal C-extension for Python3.7+ and CPython only.
     # PyPy does not need this.
@@ -130,10 +129,6 @@
     if not os.path.isfile("configmix/_speedups.pyd"):
         raise RuntimeError("no _speedups.pyd found")
 
-    if os.path.isdir(PROJECT_NAME + ".egg-info"):
-        raise RuntimeError(
-            "please remove %s.egg-info before" % (PROJECT_NAME,))
-
     setup_extra_kwds["package_data"] = {
         "configmix": ["*.pyd"]
     }