Skip to content

Commit 92397ee

Browse files
author
Jonathon Belotti
committed
working changes, tested with branch 'groodt-tensorflow-test'
1 parent d8690f3 commit 92397ee

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/purelib.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import pathlib
23
import shutil
34

@@ -18,4 +19,15 @@ def spread_purelib_into_root(extracted_whl_directory: str) -> None:
1819
return
1920

2021
dot_data_dir = wheel.get_dot_data_directory(extracted_whl_directory)
21-
shutil.move(dot_data_dir, extracted_whl_directory)
22+
23+
# 'Root-Is-Purelib: false' is no gaurante a .date directory exists with
24+
# package code in it. eg. the 'markupsafe' package.
25+
if dot_data_dir:
26+
for child in pathlib.Path(dot_data_dir).iterdir():
27+
# TODO(Jonathon): Should all other potential folders get ignored?
28+
if str(child).endswith("purelib"):
29+
for grandchild in child.iterdir():
30+
shutil.move(
31+
src=str(grandchild),
32+
dst=extracted_whl_directory,
33+
)

0 commit comments

Comments
 (0)