summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2020-01-04 17:54:39 +0000
committerGerrit Code Review <gerrit@bbpush.zzzcomputing.com>2020-01-04 17:54:39 +0000
commit4b2a0ca7aef4a1af4a2cd26eaae3055e930f42b7 (patch)
tree102c8f0e8c090440f540bee82d3b59b5bcc33479 /setup.py
parent04b2203e28e75e3a20b3536beadf8eda0dfa117b (diff)
parenta54a0c6ec7aae89003cbb47c79a1850248f57a29 (diff)
downloadsqlalchemy-4b2a0ca7aef4a1af4a2cd26eaae3055e930f42b7.tar.gz
Merge "Fix cext for Python 2; ensure C extensions build successfully"
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index a5a2af248..c520857a2 100644
--- a/setup.py
+++ b/setup.py
@@ -125,6 +125,12 @@ def run_setup(with_cext):
if with_cext:
kwargs["ext_modules"] = ext_modules
else:
+ if os.environ.get("REQUIRE_SQLALCHEMY_CEXT"):
+ raise AssertionError(
+ "Can't build on this platform with "
+ "REQUIRE_SQLALCHEMY_CEXT set."
+ )
+
kwargs["ext_modules"] = []
setup(
@@ -197,6 +203,15 @@ else:
try:
run_setup(True)
except BuildFailed as exc:
+
+ if os.environ.get("REQUIRE_SQLALCHEMY_CEXT"):
+ status_msgs(
+ "NOTE: C extension build is required because "
+ "REQUIRE_SQLALCHEMY_CEXT is set, and the build has failed; "
+ "will not degrade to non-C extensions"
+ )
+ raise
+
status_msgs(
exc.cause,
"WARNING: The C extension could not be compiled, "