From 8c65dca6c57f47c35d96614628feb65f6750217a Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Fri, 9 Dec 2016 10:07:27 -0500 Subject: [PATCH] Add a clean command to setup (#13) --- setup.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e368c89..306cb5b 100644 --- a/setup.py +++ b/setup.py @@ -8,6 +8,20 @@ except ImportError: use_setuptools() from setuptools import setup +from setuptools import setup, Command + +class CleanCommand(Command): + """Custom clean command to tidy up the project root.""" + user_options = [] + def initialize_options(self): + pass + def finalize_options(self): + pass + def run(self): + os.system('rm -vrf ./build ./dist ./*.pyc ./*.tgz ./*.egg-info') + os.system('rm -vrf htmlcov .coverage') + os.system('rm -vrf .DS_Store') + setup( name="django-dbfilestorage", version="0.1.0", @@ -41,5 +55,8 @@ setup( "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules", - ] + ], + cmdclass={ + 'clean': CleanCommand, + } )