Skip to content
This repository was archived by the owner on Apr 22, 2024. It is now read-only.

Commit 43feaed

Browse files
authored
Merge pull request #366 from diraol/fix-setup-clean-command
Fixing setup.py clean command
2 parents 4d8ba33 + 62a38e4 commit 43feaed

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

setup.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
descriptions.
55
"""
66
from abc import abstractmethod
7+
# Disabling checks due to https://github.com/PyCQA/pylint/issues/73
8+
from distutils.command.clean import clean # pylint: disable=E0401,E0611
79
from subprocess import call
810

911
from setuptools import Command, find_packages, setup
@@ -33,15 +35,17 @@ def finalize_options(self):
3335
pass
3436

3537

36-
class Cleaner(SimpleCommand):
38+
class Cleaner(clean):
3739
"""Custom clean command to tidy up the project root."""
3840

3941
description = 'clean build, dist, pyc and egg from package and docs'
4042

4143
def run(self):
4244
"""Clean build, dist, pyc and egg from package and docs."""
45+
super().run()
4346
call('rm -vrf ./build ./dist ./*.pyc ./*.egg-info', shell=True)
44-
call('cd docs; make clean', shell=True)
47+
call('find . -name __pycache__ -type d | xargs rm -rf', shell=True)
48+
call('test -d docs && make -C docs/ clean', shell=True)
4549

4650

4751
class TestCoverage(SimpleCommand):

0 commit comments

Comments
 (0)