From 9714b96702b5e205b5a2cbf553567e1bd1fa5edf Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Fri, 27 Oct 2023 09:09:08 -0700 Subject: [PATCH] Build & Clean: In Setuptools --- setup.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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)