From ddba7cc6542cb0d267d07d99a4b879f26c665729 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Mon, 10 May 2021 13:28:20 +0200 Subject: [PATCH] Make the pg3dec extension optional --- psycopg3_c/setup.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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, -- 2.47.2