diff options
author | Federico Caselli <cfederico87@gmail.com> | 2020-03-28 11:04:44 +0100 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-03-28 13:23:12 -0400 |
commit | 5b6a1a98903830ac563f936ccbe1fe30d88ec77c (patch) | |
tree | 68a7bee4f772718aafdd0e1bd8bf0e2548d482d1 /setup.py | |
parent | ee1e1e2f5540a6e32986b1041db4dfd55894e68b (diff) | |
download | sqlalchemy-5b6a1a98903830ac563f936ccbe1fe30d88ec77c.tar.gz |
Fix typo in resultproxy.c and test compatibility with python 3.5
- Fix typo in resultproxy.c that would error on windows.
- add -Wundef to C flags when linux is detected so that undefined
symbols emit a warning
- a few adjustments for tests to succeed on python 3.5
- note minimum version still documented here as 3.4 but this should
move to at least 3.5 if not 3.6 for SQLAlchemy 1.4
Change-Id: Ia93ee1cb5c52e51e72eb0a24c100421c5157d04b
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 24 |
1 files changed, 16 insertions, 8 deletions
@@ -20,27 +20,35 @@ if sys.version_info < (2, 7): cpython = platform.python_implementation() == "CPython" +ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError) +if sys.platform == "win32": + # Work around issue https://github.com/pypa/setuptools/issues/1902 + ext_errors += (IOError, TypeError) + extra_compile_args = [] +elif sys.platform == "linux": + # warn for undefined symbols in .c files + extra_compile_args = ["-Wundef"] +else: + extra_compile_args = [] + ext_modules = [ Extension( "sqlalchemy.cprocessors", sources=["lib/sqlalchemy/cextension/processors.c"], + extra_compile_args=extra_compile_args, ), Extension( "sqlalchemy.cresultproxy", sources=["lib/sqlalchemy/cextension/resultproxy.c"], + extra_compile_args=extra_compile_args, ), Extension( - "sqlalchemy.cutils", sources=["lib/sqlalchemy/cextension/utils.c"] + "sqlalchemy.cutils", + sources=["lib/sqlalchemy/cextension/utils.c"], + extra_compile_args=extra_compile_args, ), ] -ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError) -if sys.platform == "win32": - # 2.6's distutils.msvc9compiler can raise an IOError when failing to - # find the compiler - # for TypeError, see https://github.com/pypa/setuptools/issues/1902 - ext_errors += (IOError, TypeError) - class BuildFailed(Exception): def __init__(self): |