File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 22import importlib
33import zipfile
44import glob
5+ from shutil import rmtree
56from six import PY2 , with_metaclass
67
78import sh
@@ -714,6 +715,21 @@ class PythonRecipe(Recipe):
714715 setup_extra_args = []
715716 '''List of extra arugments to pass to setup.py'''
716717
718+ def clean_build (self , arch = None ):
719+ super (PythonRecipe , self ).clean_build (arch = arch )
720+ name = self .site_packages_name
721+ if name is None :
722+ name = self .name
723+ python_install_dirs = glob .glob (join (self .ctx .python_installs_dir , '*' ))
724+ for python_install in python_install_dirs :
725+ site_packages_dir = glob .glob (join (python_install , 'lib' , 'python*' ,
726+ 'site-packages' ))
727+ if site_packages_dir :
728+ build_dir = join (site_packages_dir [0 ], name )
729+ if exists (build_dir ):
730+ info ('Deleted {}' .format (build_dir ))
731+ rmtree (build_dir )
732+
717733 @property
718734 def real_hostpython_location (self ):
719735 if 'hostpython2' in self .ctx .recipe_build_order :
You can’t perform that action at this time.
0 commit comments