39
39
import copy
40
40
import itertools
41
41
import logging
42
- from typing import Any , Callable , Iterator , List , Optional
42
+ from typing import Callable , Iterator , List , Optional
43
43
44
44
from git .git_repository import GitRepository
45
45
from manifests .component_manifest import Component , ComponentManifest , Components
@@ -101,7 +101,7 @@ class InputManifest(ComponentManifest['InputManifest', 'InputComponents']):
101
101
},
102
102
}
103
103
104
- def __init__ (self , data : Any ) :
104
+ def __init__ (self , data : dict ) -> None :
105
105
super ().__init__ (data )
106
106
107
107
self .build = self .Build (data ["build" ])
@@ -123,14 +123,14 @@ def stable(self) -> 'InputManifest':
123
123
return manifest
124
124
125
125
class Ci :
126
- def __init__ (self , data : Any ) :
126
+ def __init__ (self , data : dict ) -> None :
127
127
self .image = None if data is None else self .Image (data .get ("image" , None ))
128
128
129
129
def __to_dict__ (self ) -> Optional [dict ]:
130
130
return None if self .image is None else {"image" : self .image .__to_dict__ ()}
131
131
132
132
class Image :
133
- def __init__ (self , data : Any ) :
133
+ def __init__ (self , data : dict ) -> None :
134
134
self .name = data ["name" ]
135
135
self .args = data .get ("args" , None )
136
136
@@ -141,7 +141,7 @@ def __to_dict__(self) -> dict:
141
141
}
142
142
143
143
class Build :
144
- def __init__ (self , data : Any ) :
144
+ def __init__ (self , data : dict ) -> None :
145
145
self .name : str = data ["name" ]
146
146
self .version = data ["version" ]
147
147
self .qualifier = data .get ("qualifier" , None )
@@ -168,7 +168,7 @@ def filename(self) -> str:
168
168
169
169
class InputComponents (Components ['InputComponent' ]):
170
170
@classmethod
171
- def __create__ (self , data : Any ) -> 'InputComponent' :
171
+ def __create__ (self , data : dict ) -> 'InputComponent' :
172
172
return InputComponent ._from (data ) # type: ignore[no-any-return]
173
173
174
174
def __stabilize__ (self ) -> None :
@@ -199,13 +199,13 @@ def select(self, focus: List[str] = [], platform: str = None) -> Iterator['Input
199
199
200
200
201
201
class InputComponent (Component ):
202
- def __init__ (self , data : Any ) :
202
+ def __init__ (self , data : dict ) -> None :
203
203
super ().__init__ (data )
204
204
self .platforms = data .get ("platforms" , None )
205
205
self .checks = list (map (lambda entry : Check (entry ), data .get ("checks" , [])))
206
206
207
207
@classmethod
208
- def _from (self , data : Any ) -> 'InputComponent' :
208
+ def _from (self , data : dict ) -> 'InputComponent' :
209
209
if "repository" in data :
210
210
return InputComponentFromSource (data )
211
211
elif "dist" in data :
@@ -232,7 +232,7 @@ def __stabilize__(self) -> None:
232
232
233
233
234
234
class InputComponentFromSource (InputComponent ):
235
- def __init__ (self , data : Any ) -> None :
235
+ def __init__ (self , data : dict ) -> None :
236
236
super ().__init__ (data )
237
237
self .repository = data ["repository" ]
238
238
self .ref = data ["ref" ]
@@ -255,7 +255,7 @@ def __to_dict__(self) -> dict:
255
255
256
256
257
257
class InputComponentFromDist (InputComponent ):
258
- def __init__ (self , data : Any ) :
258
+ def __init__ (self , data : dict ) -> None :
259
259
super ().__init__ (data )
260
260
self .dist = data ["dist" ]
261
261
@@ -269,7 +269,7 @@ def __to_dict__(self) -> dict:
269
269
270
270
271
271
class Check :
272
- def __init__ (self , data : Any ) -> None :
272
+ def __init__ (self , data : dict ) -> None :
273
273
if isinstance (data , dict ):
274
274
if len (data ) != 1 :
275
275
raise ValueError (f"Invalid check format: { data } " )
0 commit comments