Inherit clean command so that it supports the usual flags.
This changes the semantics of setup.py slightly. '--all' needs to be passed in order to delete everything that is deleted by previous versions. Some additional build files may also be deleted.
This commit is contained in:
parent
b78bb9e970
commit
4683fa3d25
1 changed files with 3 additions and 13 deletions
16
setup.py
16
setup.py
|
|
@ -9,6 +9,7 @@ versioneer.tag_prefix = ''
|
|||
versioneer.parentdir_prefix = ''
|
||||
|
||||
from setuptools import setup, find_packages, Command
|
||||
from distutils.command.clean import clean as Clean
|
||||
import os
|
||||
import shutil
|
||||
import glob
|
||||
|
|
@ -26,21 +27,10 @@ def package_data_dirs(source, sub_folders):
|
|||
return dirs
|
||||
|
||||
|
||||
class CleanCommand(Command):
|
||||
description = "clean build artifacts"
|
||||
user_options = []
|
||||
boolean_options = []
|
||||
|
||||
def initialize_options(self):
|
||||
pass
|
||||
|
||||
def finalize_options(self):
|
||||
pass
|
||||
class CleanCommand(Clean):
|
||||
|
||||
def run(self):
|
||||
if os.path.exists('build'):
|
||||
print "Deleting build directory"
|
||||
shutil.rmtree('build')
|
||||
Clean.run(self)
|
||||
eggs = glob.glob('OctoPrint*.egg-info')
|
||||
for egg in eggs:
|
||||
print "Deleting %s directory" % egg
|
||||
|
|
|
|||
Loading…
Reference in a new issue