8000 BUG: restore setup.py clean functionality · lithuak/scikit-learn@8546776 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8546776

Browse files
committed
BUG: restore setup.py clean functionality
Proper implementation of the clean command.
1 parent 4ee4fe6 commit 8546776

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

setup.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import sys
99
import os
1010
import shutil
11-
from distutils.core import Command
11+
from distutils.command.clean import clean as Clean
1212

1313
if sys.version_info[0] < 3:
1414
import __builtin__ as builtins
@@ -56,18 +56,11 @@
5656

5757
###############################################################################
5858

59-
class CleanCommand(Command):
59+
class CleanCommand(Clean):
6060
description = "Remove build directories, and compiled file in the source tree"
61-
user_options = []
62-
63-
def initialize_options(self):
64-
self.cwd = None
65-
66-
def finalize_options(self):
67-
self.cwd = os.getcwd()
6861

6962
def run(self):
70-
assert < 5157 span class="pl-s1 x">os.getcwd() == self.cwd, 'Must be in package root: %s' % self.cwd
63+
Clean.run(self)
7164
if os.path.exists('build'):
7265
shutil.rmtree('build')
7366
for dirpath, dirnames, filenames in os.walk('sklearn'):

0 commit comments

Comments
 (0)
0