Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change email-related fields in Metadata to str #596

Merged
merged 1 commit into from Oct 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 8 additions & 13 deletions packaging/metadata.py
Expand Up @@ -7,7 +7,6 @@
from .version import Version

# Type aliases.
_NameAndEmail = Tuple[Optional[str], str]
_LabelAndURL = Tuple[str, str]


Expand Down Expand Up @@ -75,13 +74,13 @@ class Metadata:
keywords: List[str]
home_page: str
author: str
author_emails: List[_NameAndEmail]
author_email: str
license: str
supported_platforms: List[str]
download_url: str
classifiers: List[str]
maintainer: str
maintainer_emails: List[_NameAndEmail]
maintainer_email: str
requires_dists: List[Requirement]
requires_python: SpecifierSet
requires_externals: List[str]
Expand All @@ -104,15 +103,15 @@ def __init__(
keywords: Optional[Iterable[str]] = None,
home_page: Optional[str] = None,
author: Optional[str] = None,
author_emails: Optional[Iterable[_NameAndEmail]] = None,
author_email: Optional[str] = None,
license: Optional[str] = None,
# 1.1
supported_platforms: Optional[Iterable[str]] = None,
download_url: Optional[str] = None,
classifiers: Optional[Iterable[str]] = None,
# 1.2
maintainer: Optional[str] = None,
maintainer_emails: Optional[Iterable[_NameAndEmail]] = None,
maintainer_email: Optional[str] = None,
requires_dists: Optional[Iterable[Requirement]] = None,
requires_python: Optional[SpecifierSet] = None,
requires_externals: Optional[Iterable[str]] = None,
Expand All @@ -137,17 +136,13 @@ def __init__(
:param keywords: ``Keywords``
:param home_page: ``Home-Page``
:param author: ``Author``
:param author_emails:
``Author-Email`` (two-item tuple represents the name and email of the
author)
:param author_email: ``Author-Email``
:param license: ``License``
:param supported_platforms: ``Supported-Platform``
:param download_url: ``Download-URL``
:param classifiers: ``Classifier``
:param maintainer: ``Maintainer``
:param maintainer_emails:
``Maintainer-Email`` (two-item tuple represent the name and email of the
maintainer)
:param maintainer_email: ``Maintainer-Email``
:param requires_dists: ``Requires-Dist``
:param SpecifierSet requires_python: ``Requires-Python``
:param requires_externals: ``Requires-External``
Expand All @@ -166,13 +161,13 @@ def __init__(
self.keywords = list(keywords or [])
self.home_page = home_page or ""
self.author = author or ""
self.author_emails = list(author_emails or [])
self.author_emails = author_email or ""
self.license = license or ""
self.supported_platforms = list(supported_platforms or [])
self.download_url = download_url or ""
self.classifiers = list(classifiers or [])
self.maintainer = maintainer or ""
self.maintainer_emails = list(maintainer_emails or [])
self.maintainer_emails = maintainer_email or ""
self.requires_dists = list(requires_dists or [])
self.requires_python = requires_python or SpecifierSet()
self.requires_externals = list(requires_externals or [])
Expand Down