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 5f91531
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 @@ -16,6 +14,7 @@

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


class CopyPreBuild(build):
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 5f91531

Please sign in to comment.