Empty build directory before building distributions

Mainly to avoid pypa/wheel#147
This commit is contained in:
Pradyun Gedam 2020-01-21 18:35:12 +05:30
parent bda17b73e6
commit b9555fb9d4
No known key found for this signature in database
GPG Key ID: DA17C4B29CB32E4B
1 changed files with 4 additions and 0 deletions

View File

@ -203,6 +203,10 @@ def build_release(session):
session.log("# Checkout the tag")
session.run("git", "checkout", version, external=True, silent=True)
session.log("# Cleanup build/ before building the wheel")
if release.have_files_in_folder("build"):
shutil.rmtree("build")
session.log("# Build distributions")
session.run("python", "setup.py", "sdist", "bdist_wheel", silent=True)