From 2072c80d061fc879dd51ce67dbd5ed672b92a9cd Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Sun, 18 Feb 2018 19:57:17 -0800 Subject: [PATCH] Improve error message for "setup.py upload" without dist files (GH-21060) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 08a6926b2584040fe3c3f06263b0b5f1fbbdc24c) Co-authored-by: Éric Araujo --- Lib/distutils/command/upload.py | 3 ++- .../next/Library/2018-02-17-19-20-19.bpo-21060.S1Z-x6.rst | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Library/2018-02-17-19-20-19.bpo-21060.S1Z-x6.rst diff --git a/Lib/distutils/command/upload.py b/Lib/distutils/command/upload.py index f7752f9d12c..32dda359bad 100644 --- a/Lib/distutils/command/upload.py +++ b/Lib/distutils/command/upload.py @@ -57,7 +57,8 @@ class upload(PyPIRCCommand): def run(self): if not self.distribution.dist_files: - msg = "No dist file created in earlier command" + msg = ("Must create and upload files in one command " + "(e.g. setup.py sdist upload)") raise DistutilsOptionError(msg) for command, pyversion, filename in self.distribution.dist_files: self.upload_file(command, pyversion, filename) diff --git a/Misc/NEWS.d/next/Library/2018-02-17-19-20-19.bpo-21060.S1Z-x6.rst b/Misc/NEWS.d/next/Library/2018-02-17-19-20-19.bpo-21060.S1Z-x6.rst new file mode 100644 index 00000000000..4e0a1136208 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-02-17-19-20-19.bpo-21060.S1Z-x6.rst @@ -0,0 +1,3 @@ +Rewrite confusing message from setup.py upload from +"No dist file created in earlier command" to the more helpful +"Must create and upload files in one command".