]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Make the pg3dec extension optional decimal-mpdec
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 10 May 2021 11:28:20 +0000 (13:28 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 10 May 2021 14:11:47 +0000 (16:11 +0200)
psycopg3_c/setup.py

index bd070c79813d1c08711406b86738aa45d8cc6cbf..57b625c9d68ee9c0424625c628a74fa540794c36 100644 (file)
@@ -96,6 +96,21 @@ class psycopg3_build_ext(build_ext):
         else:
             self.distribution.ext_modules = ext_modules
 
+    def build_extension(self, ext):
+        try:
+            super().build_extension(ext)
+        except Exception:
+            if ext.name != "psycopg3_c.pg3dec":
+                raise
+            log.error(
+                f"""
+building the extension {ext.name} failed.
+
+This extension is optional, so the package has been built anyway. In order to
+ensure the best performance you may want to fix the error above.
+"""
+            )
+
 
 setup(
     version=version,