From: Daniele Varrazzo Date: Mon, 10 May 2021 11:28:20 +0000 (+0200) Subject: Make the pg3dec extension optional X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fdecimal-mpdec;p=thirdparty%2Fpsycopg.git Make the pg3dec extension optional --- diff --git a/psycopg3_c/setup.py b/psycopg3_c/setup.py index bd070c798..57b625c9d 100644 --- a/psycopg3_c/setup.py +++ b/psycopg3_c/setup.py @@ -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,