Skip to content

Commit

Permalink
Added empty options in setup.cfg
Browse files Browse the repository at this point in the history
Setuptools removes them from the sdist, see psycopg#453
  • Loading branch information
dvarrazzo committed Dec 25, 2016
1 parent c9798ec commit d48d4ba
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
15 changes: 7 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,23 @@ define=

# "pg_config" is required to locate PostgreSQL headers and libraries needed to
# build psycopg2. If pg_config is not in the path or is installed under a
# different name uncomment the following option and set it to the pg_config
# full path.
#pg_config=
# different name set the following option to the pg_config full path.
pg_config=

# Set to 1 to use Python datetime objects for default date/time representation.
use_pydatetime=1

# If the build system does not find the mx.DateTime headers, try
# uncommenting the following line and setting its value to the right path.
#mx_include_dir=
# setting its value to the right path.
mx_include_dir=

# For Windows only:
# Set to 1 if the PostgreSQL library was built with OpenSSL.
# Required to link in OpenSSL libraries and dependencies.
have_ssl=0

# Statically link against the postgresql client library.
#static_libpq=1
# Set to 1 to statically link against the postgresql client library.
static_libpq=0

# Add here eventual extra libraries required to link the module.
#libraries=
libraries=
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,11 @@ def finalize_linux(self):

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)
Expand Down Expand Up @@ -521,7 +526,7 @@ def is_py_64():
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'))
Expand Down

0 comments on commit d48d4ba

Please sign in to comment.