From 63a031ecb43fd0ce6d0ae2a8b1d9303d7e9a0325 Mon Sep 17 00:00:00 2001 From: Matthew Turk Date: Tue, 28 Jul 2020 10:59:37 -0500 Subject: [PATCH] Fix conda_env embree checks --- setupext.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/setupext.py b/setupext.py index d51b10d3713..fc5809b30b5 100644 --- a/setupext.py +++ b/setupext.py @@ -143,17 +143,13 @@ def check_for_pyembree(std_libs): embree_libs = [] embree_aliases = {} try: - fn = resource_filename("pyembree", "rtcore.pxd") + _ = resource_filename("pyembree", "rtcore.pxd") except ImportError: return embree_libs, embree_aliases embree_prefix = os.path.abspath(read_embree_location()) embree_inc_dir = os.path.join(embree_prefix, "include") embree_lib_dir = os.path.join(embree_prefix, "lib") - if in_conda_env(): - conda_basedir = os.path.dirname(os.path.dirname(sys.executable)) - embree_inc_dir.append(os.path.join(conda_basedir, "include")) - embree_lib_dir.append(os.path.join(conda_basedir, "lib")) if _platform == "darwin": embree_lib_name = "embree.2" @@ -164,6 +160,12 @@ def check_for_pyembree(std_libs): embree_aliases["EMBREE_LIB_DIR"] = [embree_lib_dir] embree_aliases["EMBREE_LIBS"] = std_libs + [embree_lib_name] embree_libs += ["yt/utilities/lib/embree_mesh/*.pyx"] + + if in_conda_env(): + conda_basedir = os.path.dirname(os.path.dirname(sys.executable)) + embree_aliases["EMBREE_INC_DIR"].append(os.path.join(conda_basedir, "include")) + embree_aliases["EMBREE_LIB_DIR"].append(os.path.join(conda_basedir, "lib")) + return embree_libs, embree_aliases