Skip to content

Commit e5ee2c7

Browse files
committed
Don't build some extensions on windows
1 parent 02d0071 commit e5ee2c7

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

setup.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
raise RuntimeError(error_msg)
5151

5252
with_setuptools = False
53+
is_windows = sys.platform == "win32"
5354

5455
try:
5556
from setuptools import setup
@@ -89,7 +90,7 @@ def newrelic_agent_next_version(version):
8990
with readme_file.open() as f:
9091
readme_file_contents = f.read()
9192

92-
if sys.platform == "win32" and python_version > (2, 6):
93+
if is_windows:
9394
build_ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError, IOError)
9495
else:
9596
build_ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError)
@@ -215,11 +216,18 @@ def _run_setup():
215216

216217
kwargs_tmp["ext_modules"] = [
217218
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"]),
222219
]
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+
223231
kwargs_tmp["cmdclass"] = dict(build_ext=optional_build_ext)
224232

225233
setup(**kwargs_tmp)

0 commit comments

Comments
 (0)