Return a list of parties found in a ``metainfo`` object or mapping. Uses the provided keys with a default to key names used in METADATA. setup.py and setup.cfg use lower case valid Python identifiers instead.
(
metainfo,
author_key='Author',
author_email_key='Author-email',
maintainer_key='Maintainer',
maintainer_email_key='Maintainer-email',
)
| 2019 | |
| 2020 | |
| 2021 | def get_parties( |
| 2022 | metainfo, |
| 2023 | author_key='Author', |
| 2024 | author_email_key='Author-email', |
| 2025 | maintainer_key='Maintainer', |
| 2026 | maintainer_email_key='Maintainer-email', |
| 2027 | ): |
| 2028 | """ |
| 2029 | Return a list of parties found in a ``metainfo`` object or mapping. |
| 2030 | Uses the provided keys with a default to key names used in METADATA. |
| 2031 | setup.py and setup.cfg use lower case valid Python identifiers instead. |
| 2032 | """ |
| 2033 | parties = [] |
| 2034 | |
| 2035 | author = get_attribute(metainfo, author_key) |
| 2036 | |
| 2037 | author_email = get_attribute(metainfo, author_email_key) |
| 2038 | if author or author_email: |
| 2039 | parties.append(models.Party( |
| 2040 | type=models.party_person, |
| 2041 | name=author or None, |
| 2042 | role='author', |
| 2043 | email=author_email or None, |
| 2044 | )) |
| 2045 | |
| 2046 | maintainer = get_attribute(metainfo, maintainer_key) |
| 2047 | maintainer_email = get_attribute(metainfo, maintainer_email_key) |
| 2048 | if maintainer or maintainer_email: |
| 2049 | parties.append(models.Party( |
| 2050 | type=models.party_person, |
| 2051 | name=maintainer or None, |
| 2052 | role='maintainer', |
| 2053 | email=maintainer_email or None, |
| 2054 | )) |
| 2055 | |
| 2056 | return parties |
| 2057 | |
| 2058 | |
| 2059 | def get_setup_parties(setup_kwargs): |
no test coverage detected