5050from mp_api .client .contribs ._logger import MPCC_LOGGER , TqdmToLogger
5151from mp_api .client .contribs ._types import (
5252 Attachment ,
53+ ComponentIdSets ,
5354 MPCDict ,
5455 MPCStructure ,
5556 Table ,
7172 from collections .abc import Generator , Iterable , Sequence
7273 from typing import Any
7374
74- from mp_api .client .contribs .types import (
75+ from mp_api .client .contribs ._types import (
7576 AllIdMap ,
7677 AllIdSets ,
77- ComponentIdSets ,
7878 IdentifierLeaf ,
7979 ProjectIdSets ,
8080 )
8888warnings .filterwarnings ("default" , category = DeprecationWarning , module = __name__ )
8989
9090
91- def validate_email (email_string : str ):
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):
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