From bda17b73e618f2d229508f6c2c902168817f8179 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Tue, 21 Jan 2020 18:33:33 +0530 Subject: [PATCH 1/2] Add dist/ prefix to expected filenames --- noxfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index c19ff37c1a8..655aa076e8e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -234,8 +234,8 @@ def upload_release(session): ) # Sanity check: Make sure the files are correctly named. expected_distribution_files = [ - f"pip-{version}-py2.py3-none-any.whl", - f"pip-{version}.tar.gz", + f"dist/pip-{version}-py2.py3-none-any.whl", + f"dist/pip-{version}.tar.gz", ] if sorted(distribution_files) != sorted(expected_distribution_files): session.error( From b9555fb9d48ea97a782530db9edb47c8e2578de0 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Tue, 21 Jan 2020 18:35:12 +0530 Subject: [PATCH 2/2] Empty build directory before building distributions Mainly to avoid pypa/wheel#147 --- noxfile.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/noxfile.py b/noxfile.py index 655aa076e8e..2151ce37e08 100644 --- a/noxfile.py +++ b/noxfile.py @@ -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)