[Python-checkins] bpo-38914 Do not require email field in setup.py. (GH-17388)
Miss Islington (bot)
webhook-mailer at python.org
Mon Dec 23 09:53:22 EST 2019
https://github.com/python/cpython/commit/9f9dac0a4e58d5c72aa3b644701cb155c009cb2c
commit: 9f9dac0a4e58d5c72aa3b644701cb155c009cb2c
branch: master
author: Jürgen Gmach <juergen.gmach at googlemail.com>
committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
date: 2019-12-23T06:53:18-08:00
summary:
bpo-38914 Do not require email field in setup.py. (GH-17388)
When checking `setup.py` and when the `author` field was provided, but
the `author_email` field was missing, erroneously a warning message was
displayed that the `author_email` field is required.
The specs do not require the `author_email`field:
https://packaging.python.org/specifications/core-metadata/#author
The same is valid for `maintainer` and `maintainer_email`.
The warning message has been adjusted.
modified: Doc/distutils/examples.rst
modified: Lib/distutils/command/check.py
https://bugs.python.org/issue38914
files:
A Misc/NEWS.d/next/Library/2019-11-26-23-21-56.bpo-38914.8l-g-T.rst
M Doc/distutils/examples.rst
M Lib/distutils/command/check.py
diff --git a/Doc/distutils/examples.rst b/Doc/distutils/examples.rst
index 44f70831d0bf8..e492b7f605759 100644
--- a/Doc/distutils/examples.rst
+++ b/Doc/distutils/examples.rst
@@ -255,7 +255,7 @@ Running the ``check`` command will display some warnings:
running check
warning: check: missing required meta-data: version, url
warning: check: missing meta-data: either (author and author_email) or
- (maintainer and maintainer_email) must be supplied
+ (maintainer and maintainer_email) should be supplied
If you use the reStructuredText syntax in the ``long_description`` field and
diff --git a/Lib/distutils/command/check.py b/Lib/distutils/command/check.py
index 04c2f9642d733..7ceabd3adf22d 100644
--- a/Lib/distutils/command/check.py
+++ b/Lib/distutils/command/check.py
@@ -80,8 +80,11 @@ def run(self):
def check_metadata(self):
"""Ensures that all required elements of meta-data are supplied.
- name, version, URL, (author and author_email) or
- (maintainer and maintainer_email)).
+ Required fields:
+ name, version, URL
+
+ Recommended fields:
+ (author and author_email) or (maintainer and maintainer_email))
Warns if any are missing.
"""
@@ -97,15 +100,15 @@ def check_metadata(self):
if metadata.author:
if not metadata.author_email:
self.warn("missing meta-data: if 'author' supplied, " +
- "'author_email' must be supplied too")
+ "'author_email' should be supplied too")
elif metadata.maintainer:
if not metadata.maintainer_email:
self.warn("missing meta-data: if 'maintainer' supplied, " +
- "'maintainer_email' must be supplied too")
+ "'maintainer_email' should be supplied too")
else:
self.warn("missing meta-data: either (author and author_email) " +
"or (maintainer and maintainer_email) " +
- "must be supplied")
+ "should be supplied")
def check_restructuredtext(self):
"""Checks if the long string fields are reST-compliant."""
diff --git a/Misc/NEWS.d/next/Library/2019-11-26-23-21-56.bpo-38914.8l-g-T.rst b/Misc/NEWS.d/next/Library/2019-11-26-23-21-56.bpo-38914.8l-g-T.rst
new file mode 100644
index 0000000000000..2dfc1ea149b1b
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-11-26-23-21-56.bpo-38914.8l-g-T.rst
@@ -0,0 +1,5 @@
+Adjusted the wording of the warning issued by distutils' ``check`` command when
+the ``author`` and ``maintainer`` fields are supplied but no corresponding
+e-mail field (``author_email`` or ``maintainer_email``) is found. The wording
+now reflects the fact that these fields are suggested, but not required. Patch
+by Juergen Gmach.
More information about the Python-checkins
mailing list