Empty build directory before building distributions
Mainly to avoid pypa/wheel#147
@@ -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)
