Skip to content

Commit 68ca520

Browse files
committed
fix: simplify path handling in get_extensions function
1 parent 4db67bd commit 68ca520

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

setup.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ def get_extensions():
2929
extra_compile_args["cxx"] = ["-fopenmp"]
3030
extra_link_args.append("-fopenmp")
3131

32-
this_dir = os.path.abspath(os.path.dirname(__file__))
33-
extensions_dir = os.path.join(this_dir, library_name, "csrc")
32+
extensions_dir = os.path.join(library_name, "csrc")
3433
sources = list(glob.glob(os.path.join(extensions_dir, "*.cpp")))
3534

3635
extensions_cuda_dir = os.path.join(extensions_dir, "cuda")
@@ -42,8 +41,7 @@ def get_extensions():
4241
ext_modules = [
4342
extension(
4443
f"{library_name}._C",
45-
# sources,
46-
[os.path.relpath(s, this_dir) for s in sources],
44+
sources,
4745
extra_compile_args=extra_compile_args,
4846
extra_link_args=extra_link_args,
4947
py_limited_api=py_limited_api,

0 commit comments

Comments
 (0)