Skip to content

Commit 9119930

Browse files
committed
Add support for cleaning up after bdist.
1 parent 60503d9 commit 9119930

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

setupext/janitor/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def run(self):
4848
_CleanCommand.run(self)
4949
dist_dirs = set()
5050
for cmd_name in self.distribution.commands:
51-
if cmd_name == 'sdist':
51+
if 'dist' in cmd_name:
5252
command = self.distribution.get_command_obj(cmd_name)
5353
command.ensure_finalized()
5454
if getattr(command, 'dist_dir', None):

tests.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,22 @@ def test_that_dist_directory_is_removed_for_sdist(self):
9696
'clean', '--dist',
9797
)
9898
self.assert_path_does_not_exist(dist_dir)
99+
100+
def test_that_dist_directory_is_removed_for_bdist_dumb(self):
101+
dist_dir = self.create_directory('dist-dir')
102+
run_setup(
103+
'bdist_dumb', '--dist-dir={0}'.format(dist_dir),
104+
'clean', '--dist',
105+
)
106+
self.assert_path_does_not_exist(dist_dir)
107+
108+
def test_that_multiple_dist_directories_with_be_removed(self):
109+
sdist_dir = self.create_directory('sdist-dir')
110+
bdist_dir = self.create_directory('bdist_dumb')
111+
run_setup(
112+
'sdist', '--dist-dir={0}'.format(sdist_dir),
113+
'bdist_dumb', '--dist-dir={0}'.format(bdist_dir),
114+
'clean', '--dist',
115+
)
116+
self.assert_path_does_not_exist(sdist_dir)
117+
self.assert_path_does_not_exist(bdist_dir)

0 commit comments

Comments
 (0)