|
15 | 15 | from __future__ import print_function
|
16 | 16 | import os
|
17 | 17 | import sys
|
| 18 | +import json |
18 | 19 | import warnings
|
| 20 | +from pathlib import Path |
19 | 21 |
|
20 | 22 | if __name__ == '__main__' and sys.argv[1] == "gevent_nosetests":
|
21 | 23 | print("Running gevent tests")
|
@@ -142,6 +144,20 @@ def __init__(self, ext):
|
142 | 144 | murmur3_ext = Extension('cassandra.cmurmur3',
|
143 | 145 | sources=['cassandra/cmurmur3.c'])
|
144 | 146 |
|
| 147 | +is_macos = sys.platform.startswith('darwin') |
| 148 | + |
| 149 | +libev_includes = ['/usr/include/libev', '/usr/local/include', '/opt/local/include', '/usr/include'] |
| 150 | +libev_libdirs = ['/usr/local/lib', '/opt/local/lib', '/usr/lib64'] |
| 151 | +if is_macos: |
| 152 | + libev_includes.extend(['/opt/homebrew/include', os.path.expanduser('~/homebrew/include')]) |
| 153 | + libev_libdirs.extend(['/opt/homebrew/lib']) |
| 154 | + |
| 155 | +conan_envfile = Path(__file__).parent / 'build-release/conan/conandeps.env' |
| 156 | +if conan_envfile.exists(): |
| 157 | + conan_paths = json.loads(conan_envfile.read_text()) |
| 158 | + libev_includes.extend([conan_paths.get('include_dirs')]) |
| 159 | + libev_libdirs.extend([conan_paths.get('library_dirs')]) |
| 160 | + |
145 | 161 | libev_ext = Extension('cassandra.io.libevwrapper',
|
146 | 162 | sources=['cassandra/io/libevwrapper.c'],
|
147 | 163 | include_dirs=['/usr/include/libev', '/usr/local/include', '/opt/local/include'],
|
@@ -184,7 +200,7 @@ def __init__(self, ext):
|
184 | 200 |
|
185 | 201 | try_extensions = "--no-extensions" not in sys.argv and is_supported_platform and is_supported_arch and not os.environ.get('CASS_DRIVER_NO_EXTENSIONS')
|
186 | 202 | try_murmur3 = try_extensions and "--no-murmur3" not in sys.argv
|
187 |
| -try_libev = try_extensions and "--no-libev" not in sys.argv and not is_pypy and not is_windows |
| 203 | +try_libev = try_extensions and "--no-libev" not in sys.argv and not is_pypy |
188 | 204 | try_cython = try_extensions and "--no-cython" not in sys.argv and not is_pypy and not os.environ.get('CASS_DRIVER_NO_CYTHON')
|
189 | 205 | try_cython &= 'egg_info' not in sys.argv # bypass setup_requires for pip egg_info calls, which will never have --install-option"--no-cython" coming fomr pip
|
190 | 206 |
|
|
0 commit comments