Skip to content

Commit

Permalink
Build & Clean: In Setuptools
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l committed Oct 27, 2023
1 parent cf792c4 commit 9714b96
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -15,6 +13,7 @@
import sys

from setuptools import Extension, setup
from setuptools.command import build
from setuptools.command.build_ext import build_ext


Expand All @@ -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)
Expand Down

0 comments on commit 9714b96

Please sign in to comment.