Skip to content

Commit 8c3f20d

Browse files
mypy
1 parent 2100483 commit 8c3f20d

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

mp_api/client/contribs/client.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,15 @@
8888
warnings.filterwarnings("default", category=DeprecationWarning, module=__name__)
8989

9090

91-
def validate_email(email_string: str) -> AllIdMap:
91+
def validate_email(email_string: str) -> None:
9292
"""Validate user email address.
9393
9494
Args:
9595
email_string (str) : the user's email address
96+
Returns:
97+
None
98+
Raises:
99+
SwaggerValidationError on malformed email address.
96100
"""
97101
if email_string.count(":") != 1:
98102
raise SwaggerValidationError(
@@ -107,6 +111,8 @@ def validate_email(email_string: str) -> AllIdMap:
107111
if d > BaseDiagnosis.CATEGORIES["VALID"]:
108112
raise SwaggerValidationError(f"{email} {d.message}")
109113

114+
return None
115+
110116

111117
# TODO: mypy has some problems with putting a bare `str`
112118
# as a callable function in SwaggerFormat
@@ -2109,7 +2115,7 @@ def submit_contributions(
21092115
digest in digests[project_name][component]
21102116
or digest
21112117
in existing.get(project_name, {})
2112-
.get(component, {})
2118+
.get(component, {}) # type: ignore[union-attr]
21132119
.get("md5s", [])
21142120
)
21152121

@@ -2227,9 +2233,9 @@ def put_future(pk, payload):
22272233
pk=project_name, _fields=["unique_identifiers"]
22282234
).result()["unique_identifiers"]
22292235
)
2230-
existing_ids = existing.get(project_name, {}).get(
2231-
"identifiers", []
2232-
)
2236+
existing_ids: Iterable[str] = existing.get(
2237+
project_name, {}
2238+
).get("identifiers", [])
22332239
contribs[project_name] = [
22342240
c
22352241
for c in contribs[project_name]

0 commit comments

Comments
 (0)