Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2c4e1d7

Browse filesBrowse files
authored
BLD Clean command removes generated from cython templates (#25839)
1 parent fd9bff1 commit 2c4e1d7
Copy full SHA for 2c4e1d7

File tree

1 file changed

+9
-6
lines changed
Filter options

1 file changed

+9
-6
lines changed

‎setup.py

Copy file name to clipboardExpand all lines: setup.py
+9-6Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,20 @@ def run(self):
7979
shutil.rmtree("build")
8080
for dirpath, dirnames, filenames in os.walk("sklearn"):
8181
for filename in filenames:
82-
if any(
83-
filename.endswith(suffix)
84-
for suffix in (".so", ".pyd", ".dll", ".pyc")
85-
):
82+
root, extension = os.path.splitext(filename)
83+
84+
if extension in [".so", ".pyd", ".dll", ".pyc"]:
8685
os.unlink(os.path.join(dirpath, filename))
87-
continue
88-
extension = os.path.splitext(filename)[1]
86+
8987
if remove_c_files and extension in [".c", ".cpp"]:
9088
pyx_file = str.replace(filename, extension, ".pyx")
9189
if os.path.exists(os.path.join(dirpath, pyx_file)):
9290
os.unlink(os.path.join(dirpath, filename))
91+
92+
if remove_c_files and extension == ".tp":
93+
if os.path.exists(os.path.join(dirpath, root)):
94+
os.unlink(os.path.join(dirpath, root))
95+
9396
for dirname in dirnames:
9497
if dirname == "__pycache__":
9598
shutil.rmtree(os.path.join(dirpath, dirname))

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.