Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,15 @@ def finalize_options(self):
class LlvmliteClean(clean):
"""Custom clean command to tidy up the project root."""
def run(self):
clean.run(self)
super().run()
path = os.path.join(here_dir, 'llvmlite.egg-info')
if os.path.isdir(path):
remove_tree(path, dry_run=self.dry_run)
# remove ffi/build
path = os.path.join(here_dir, 'ffi', 'build')
if os.path.isdir(path):
remove_tree(path, dry_run=self.dry_run)
# remove all __pycache__
if not self.dry_run:
self._rm_walk()

Expand All @@ -140,8 +145,8 @@ def _rm_walk(self):
remove_tree(path, dry_run=self.dry_run)
else:
for fname in files:
if (fname.endswith('.pyc') or fname.endswith('.so')
or fname.endswith('.o')):
suffixes = ('.pyc', '.o', '.so', '.dylib', '.dll')
if any(fname.endswith(suffix) for suffix in suffixes):
fpath = os.path.join(path, fname)
os.remove(fpath)
log.info("removing '%s'", fpath)
Expand Down