summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2016-07-07 12:05:29 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2016-12-25 19:46:09 +0100
commitd48d4bab0520d047da1522e12ddaa51702e231d0 (patch)
tree64b08f38627a00339fc8a02deeb58de57ed981b4 /setup.py
parentc9798ecb1574c2bbf2c49ce30c96e96935663762 (diff)
downloadpsycopg2-d48d4bab0520d047da1522e12ddaa51702e231d0.tar.gz
Added empty options in setup.cfg
Setuptools removes them from the sdist, see #453
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index 3f02183..c106525 100644
--- a/setup.py
+++ b/setup.py
@@ -381,6 +381,11 @@ class psycopg_build_ext(build_ext):
def finalize_options(self):
"""Complete the build system configuration."""
+ # An empty option in the setup.cfg causes self.libraries to include
+ # an empty string in the list of libraries
+ if self.libraries is not None and not self.libraries.strip():
+ self.libraries = None
+
build_ext.finalize_options(self)
pg_config_helper = PostgresConfig(self)
@@ -521,7 +526,7 @@ if parser.has_option('build_ext', 'mx_include_dir'):
mxincludedir = parser.get('build_ext', 'mx_include_dir')
else:
mxincludedir = os.path.join(get_python_inc(plat_specific=1), "mx")
-if os.path.exists(mxincludedir):
+if mxincludedir.strip() and os.path.exists(mxincludedir):
# Build the support for mx: we will check at runtime if it can be imported
include_dirs.append(mxincludedir)
define_macros.append(('HAVE_MXDATETIME', '1'))