Skip to content

Commit a9995ac

Browse files
committed
Revert "build: diagnostic for importlib.metadata locate_file in PEP 517 builds"
This reverts commit 3cb0313.
1 parent 3cb0313 commit a9995ac

2 files changed

Lines changed: 2 additions & 36 deletions

File tree

cuda_bindings/build_hooks.py

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -56,27 +56,10 @@ def _import_get_cuda_path_or_home():
5656
) from None
5757
import cuda
5858

59-
locate_result = str(dist.locate_file(Path("cuda")))
60-
print(f"[diag] dist._path: {dist._path}", flush=True)
61-
print(f"[diag] dist._path.parent: {dist._path.parent}", flush=True)
62-
print(f"[diag] locate_file('cuda'): {locate_result}", flush=True)
63-
print(f"[diag] locate_file exists: {os.path.isdir(locate_result)}", flush=True)
64-
print(
65-
f"[diag] locate_file/pathfinder exists: {os.path.isdir(os.path.join(locate_result, 'pathfinder'))}",
66-
flush=True,
67-
)
68-
print(f"[diag] cuda.__path__ (before): {cuda.__path__}", flush=True)
69-
print("[diag] sys.path:", flush=True)
70-
for p in sys.path:
71-
sp_cuda = os.path.join(p, "cuda")
72-
has_pf = os.path.isdir(os.path.join(sp_cuda, "pathfinder"))
73-
print(f"[diag] {p} -> cuda/pathfinder exists: {has_pf}", flush=True)
74-
75-
site_cuda = locate_result
59+
site_cuda = str(dist.locate_file(Path("cuda")))
7660
cuda_paths = list(cuda.__path__)
7761
if site_cuda not in cuda_paths:
7862
cuda.__path__ = cuda_paths + [site_cuda]
79-
print(f"[diag] cuda.__path__ (after): {cuda.__path__}", flush=True)
8063
import cuda.pathfinder
8164

8265
return cuda.pathfinder.get_cuda_path_or_home

cuda_core/build_hooks.py

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -51,27 +51,10 @@ def _import_get_cuda_path_or_home():
5151
) from None
5252
import cuda
5353

54-
locate_result = str(dist.locate_file(Path("cuda")))
55-
print(f"[diag] dist._path: {dist._path}", flush=True)
56-
print(f"[diag] dist._path.parent: {dist._path.parent}", flush=True)
57-
print(f"[diag] locate_file('cuda'): {locate_result}", flush=True)
58-
print(f"[diag] locate_file exists: {os.path.isdir(locate_result)}", flush=True)
59-
print(
60-
f"[diag] locate_file/pathfinder exists: {os.path.isdir(os.path.join(locate_result, 'pathfinder'))}",
61-
flush=True,
62-
)
63-
print(f"[diag] cuda.__path__ (before): {cuda.__path__}", flush=True)
64-
print("[diag] sys.path:", flush=True)
65-
for p in sys.path:
66-
sp_cuda = os.path.join(p, "cuda")
67-
has_pf = os.path.isdir(os.path.join(sp_cuda, "pathfinder"))
68-
print(f"[diag] {p} -> cuda/pathfinder exists: {has_pf}", flush=True)
69-
70-
site_cuda = locate_result
54+
site_cuda = str(dist.locate_file(Path("cuda")))
7155
cuda_paths = list(cuda.__path__)
7256
if site_cuda not in cuda_paths:
7357
cuda.__path__ = cuda_paths + [site_cuda]
74-
print(f"[diag] cuda.__path__ (after): {cuda.__path__}", flush=True)
7558
import cuda.pathfinder
7659

7760
return cuda.pathfinder.get_cuda_path_or_home

0 commit comments

Comments
 (0)