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 2
2
import importlib
3
3
import zipfile
4
4
import glob
5
+ from shutil import rmtree
5
6
from six import PY2 , with_metaclass
6
7
7
8
import sh
@@ -714,6 +715,21 @@ class PythonRecipe(Recipe):
714
715
setup_extra_args = []
715
716
'''List of extra arugments to pass to setup.py'''
716
717
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
+
717
733
@property
718
734
def real_hostpython_location (self ):
719
735
if 'hostpython2' in self .ctx .recipe_build_order :
You can’t perform that action at this time.
0 commit comments