|
50 | 50 | raise RuntimeError(error_msg)
|
51 | 51 |
|
52 | 52 | with_setuptools = False
|
| 53 | +is_windows = sys.platform == "win32" |
53 | 54 |
|
54 | 55 | try:
|
55 | 56 | from setuptools import setup
|
@@ -89,7 +90,7 @@ def newrelic_agent_next_version(version):
|
89 | 90 | with readme_file.open() as f:
|
90 | 91 | readme_file_contents = f.read()
|
91 | 92 |
|
92 |
| -if sys.platform == "win32" and python_version > (2, 6): |
| 93 | +if is_windows: |
93 | 94 | build_ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError, IOError)
|
94 | 95 | else:
|
95 | 96 | build_ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError)
|
@@ -215,11 +216,18 @@ def _run_setup():
|
215 | 216 |
|
216 | 217 | kwargs_tmp["ext_modules"] = [
|
217 | 218 | Extension("newrelic.packages.wrapt._wrappers", ["newrelic/packages/wrapt/_wrappers.c"]),
|
218 |
| - Extension( |
219 |
| - "newrelic.common._monotonic", ["newrelic/common/_monotonic.c"], libraries=monotonic_libraries |
220 |
| - ), |
221 |
| - Extension("newrelic.core._thread_utilization", ["newrelic/core/_thread_utilization.c"]), |
222 | 219 | ]
|
| 220 | + if not is_windows: |
| 221 | + # These extensions are only supported on POSIX platforms. |
| 222 | + kwargs_tmp["ext_modules"].append( |
| 223 | + Extension( |
| 224 | + "newrelic.common._monotonic", ["newrelic/common/_monotonic.c"], libraries=monotonic_libraries |
| 225 | + ) |
| 226 | + ) |
| 227 | + kwargs_tmp["ext_modules"].append( |
| 228 | + Extension("newrelic.core._thread_utilization", ["newrelic/core/_thread_utilization.c"]) |
| 229 | + ) |
| 230 | + |
223 | 231 | kwargs_tmp["cmdclass"] = dict(build_ext=optional_build_ext)
|
224 | 232 |
|
225 | 233 | setup(**kwargs_tmp)
|
|
0 commit comments