diff --git a/setup.py b/setup.py index d6111451..871a6d9c 100644 --- a/setup.py +++ b/setup.py @@ -5,8 +5,6 @@ # Authors: Axel Huebl # License: BSD-3-Clause-LBNL # -from distutils.command.build import build -from distutils.command.clean import clean import os import platform import re @@ -15,6 +13,7 @@ import sys from setuptools import Extension, setup +from setuptools.command import build from setuptools.command.build_ext import build_ext @@ -32,10 +31,8 @@ def run(self): # by default, this stays around. We want to make sure generated # files like amrex_*d_pybind.*.(so|pyd) are always only the # ones we want to package and not ones from an earlier wheel's stage - c = clean(self.distribution) - c.all = True - c.finalize_options() - c.run() + if os.path.exists(self.build_base): + shutil.rmtree(self.build_base) # call superclass build.run(self)