From 16ce49460c589a89ab77bf26bb32c1e34ea14940 Mon Sep 17 00:00:00 2001 From: Jens Hedegaard Nielsen Date: Sun, 7 Aug 2016 10:19:51 +0100 Subject: [PATCH] Make setup.py clean a noop command that prints a warning --- setup.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/setup.py b/setup.py index 4b4038a7d306..35f2f42e6aab 100644 --- a/setup.py +++ b/setup.py @@ -139,6 +139,12 @@ def run(self): "'python setup.py test'. Please run 'python tests.py'") +class NoopCleanCommand(TestCommand): + def run(self): + print("Matplotlib does not support 'python setup.py clean' " + "Please use 'git clean' or manually delete the build folder.") + + class BuildExtraLibraries(BuildExtCommand): def run(self): for package in good_packages: @@ -149,6 +155,7 @@ def run(self): cmdclass = versioneer.get_cmdclass() cmdclass['test'] = NoopTestCommand +cmdclass['clean'] = NoopCleanCommand cmdclass['build_ext'] = BuildExtraLibraries # One doesn't normally see `if __name__ == '__main__'` blocks in a setup.py,