Skip to content

Commit 9f9dac0

Browse files
jugmac00miss-islington
authored andcommitted
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
1 parent e7b406f commit 9f9dac0

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

Doc/distutils/examples.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ Running the ``check`` command will display some warnings:
255255
running check
256256
warning: check: missing required meta-data: version, url
257257
warning: check: missing meta-data: either (author and author_email) or
258-
(maintainer and maintainer_email) must be supplied
258+
(maintainer and maintainer_email) should be supplied
259259
260260
261261
If you use the reStructuredText syntax in the ``long_description`` field and

Lib/distutils/command/check.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,11 @@ def run(self):
8080
def check_metadata(self):
8181
"""Ensures that all required elements of meta-data are supplied.
8282
83-
name, version, URL, (author and author_email) or
84-
(maintainer and maintainer_email)).
83+
Required fields:
84+
name, version, URL
85+
86+
Recommended fields:
87+
(author and author_email) or (maintainer and maintainer_email))
8588
8689
Warns if any are missing.
8790
"""
@@ -97,15 +100,15 @@ def check_metadata(self):
97100
if metadata.author:
98101
if not metadata.author_email:
99102
self.warn("missing meta-data: if 'author' supplied, " +
100-
"'author_email' must be supplied too")
103+
"'author_email' should be supplied too")
101104
elif metadata.maintainer:
102105
if not metadata.maintainer_email:
103106
self.warn("missing meta-data: if 'maintainer' supplied, " +
104-
"'maintainer_email' must be supplied too")
107+
"'maintainer_email' should be supplied too")
105108
else:
106109
self.warn("missing meta-data: either (author and author_email) " +
107110
"or (maintainer and maintainer_email) " +
108-
"must be supplied")
111+
"should be supplied")
109112

110113
def check_restructuredtext(self):
111114
"""Checks if the long string fields are reST-compliant."""
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Adjusted the wording of the warning issued by distutils' ``check`` command when
2+
the ``author`` and ``maintainer`` fields are supplied but no corresponding
3+
e-mail field (``author_email`` or ``maintainer_email``) is found. The wording
4+
now reflects the fact that these fields are suggested, but not required. Patch
5+
by Juergen Gmach.

0 commit comments

Comments
 (0)