setup.py
changeset 52684 9ec635cc0a29
parent 52679 30510238284e
child 52688 9ff926737dbc
--- a/setup.py	Tue Jan 14 07:31:38 2025 +0100
+++ b/setup.py	Mon Jan 13 15:52:31 2025 +0100
@@ -79,6 +79,17 @@
 from distutils.sysconfig import get_python_inc
 from distutils.ccompiler import new_compiler
 
+# raise an explicit error if setuptools_scm is not importable
+try:
+    import setuptools_scm
+except ImportError:
+    raise SystemExit(
+        "Couldn't import setuptools_scm (direct call of setup.py?)."
+    )
+else:
+    del setuptools_scm
+
+
 ispypy = "PyPy" in sys.version