@@ -45,16 +45,16 @@ class GitHubPublisherBase(wtforms.Form):
4545 # https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment
4646 environment = wtforms .StringField (validators = [wtforms .validators .Optional ()])
4747
48- def __init__ (self , * args , api_token , ** kwargs ):
48+ def __init__ (self , * args , api_token : str , ** kwargs ):
4949 super ().__init__ (* args , ** kwargs )
5050 self ._api_token = api_token
5151
52- def _headers_auth (self ):
52+ def _headers_auth (self ) -> dict [ str , str ] :
5353 if not self ._api_token :
5454 return {}
5555 return {"Authorization" : f"token { self ._api_token } " }
5656
57- def _lookup_owner (self , owner ) :
57+ def _lookup_owner (self , owner : str ) -> dict [ str , str | int ] :
5858 # To actually validate the owner, we ask GitHub's API about them.
5959 # We can't do this for the repository, since it might be private.
6060 try :
@@ -113,7 +113,7 @@ def _lookup_owner(self, owner):
113113
114114 return response .json ()
115115
116- def validate_owner (self , field ) :
116+ def validate_owner (self , field : wtforms . Field ) -> None :
117117 owner = field .data
118118
119119 # We pre-filter owners with a regex, to avoid loading GitHub's API
@@ -129,7 +129,7 @@ def validate_owner(self, field):
129129 self .normalized_owner = owner_info ["login" ]
130130 self .owner_id = owner_info ["id" ]
131131
132- def validate_workflow_filename (self , field ) :
132+ def validate_workflow_filename (self , field : wtforms . Field ) -> None :
133133 workflow_filename = field .data
134134
135135 if not (
@@ -144,7 +144,7 @@ def validate_workflow_filename(self, field):
144144 _ ("Workflow filename must be a filename only, without directories" )
145145 )
146146
147- def validate_environment (self , field ) :
147+ def validate_environment (self , field : wtforms . Field ) -> None :
148148 environment = field .data
149149
150150 if not environment :
@@ -174,7 +174,7 @@ def validate_environment(self, field):
174174 )
175175
176176 @property
177- def normalized_environment (self ):
177+ def normalized_environment (self ) -> str :
178178 # The only normalization is due to case-insensitivity.
179179 #
180180 # NOTE: We explicitly do not compare `self.environment.data` to None,
0 commit comments