@@ -25,12 +25,12 @@ def get_template_environment() -> Environment:
2525class template :
2626 """Template decorator and registry."""
2727
28- _registry : typing . Dict = dict ()
28+ _registry : dict = dict ()
2929
3030 def __init__ (self , name : str ) -> None :
3131 self .name = name
3232
33- def __call__ (self , ob : typing . Type ["Template" ]) -> typing . Type ["Template" ]:
33+ def __call__ (self , ob : type ["Template" ]) -> type ["Template" ]:
3434 ob .name = self .name
3535 self ._registry [self .name ] = ob
3636 return ob
@@ -53,7 +53,7 @@ class Template(abc.ABC):
5353
5454 def __init__ (
5555 self ,
56- environment : typing . Union [ Environment , None ] = None ,
56+ environment : Environment | None = None ,
5757 ) -> None :
5858 # XXX: if environment is None, default to ``get_template_environment``?
5959 self .environment = environment
@@ -71,7 +71,7 @@ def template_name(self) -> str:
7171 """Template name to use."""
7272
7373 @abc .abstractproperty
74- def template_variables (self ) -> typing . Dict [str , typing .Any ]:
74+ def template_variables (self ) -> dict [str , typing .Any ]:
7575 """Variables for template rendering."""
7676
7777 def write (self ) -> None :
@@ -106,13 +106,13 @@ class MxIniBoundTemplate(Template):
106106 def __init__ (
107107 self ,
108108 config : mxdev .Configuration ,
109- environment : typing . Union [ Environment , None ] = None ,
109+ environment : Environment | None = None ,
110110 ) -> None :
111111 super ().__init__ (environment )
112112 self .config = config
113113
114114 @property
115- def settings (self ) -> typing . Dict [str , str ]:
115+ def settings (self ) -> dict [str , str ]:
116116 return self .config .hooks .get (ns_name (self .name ), {})
117117
118118
@@ -123,7 +123,7 @@ class ShellScriptTemplate(Template):
123123
124124class EnvironmentTemplate (MxIniBoundTemplate ):
125125 @property
126- def env (self ) -> typing . Dict [str , str ]:
126+ def env (self ) -> dict [str , str ]:
127127 """Dict containing environment variables."""
128128 env_name = self .settings .get ("environment" )
129129 return self .config .hooks .get (ns_name (env_name ), {}) if env_name else {}
@@ -155,15 +155,15 @@ def template_name(self) -> str:
155155 return f"{ self .test_runner } -{ self .target_name } "
156156
157157 @property
158- def template_variables (self ) -> typing . Dict [str , typing .Any ]:
158+ def template_variables (self ) -> dict [str , typing .Any ]:
159159 return dict (
160160 description = self .description ,
161161 env = self .env ,
162162 testpaths = self .package_paths (ns_name ("test-path" )),
163163 testargs = self .config .settings .get ("mxmake-test-runner-args" , "" ),
164164 )
165165
166- def package_paths (self , attr : str ) -> typing . List [str ]:
166+ def package_paths (self , attr : str ) -> list [str ]:
167167 paths = list ()
168168 for name , package in self .config .packages .items ():
169169 if attr not in package :
@@ -192,7 +192,7 @@ class CoverageScript(TestScript):
192192 description : str = "Run coverage"
193193
194194 @property
195- def template_variables (self ) -> typing . Dict [str , typing .Any ]:
195+ def template_variables (self ) -> dict [str , typing .Any ]:
196196 variables = super ().template_variables
197197 variables ["sourcepaths" ] = self .package_paths (ns_name ("source-path" ))
198198 variables ["omitpaths" ] = self .package_paths (ns_name ("omit-path" ))
@@ -215,7 +215,7 @@ def target_folder(self) -> Path:
215215 return mxmake_files ()
216216
217217 @property
218- def template_variables (self ) -> typing . Dict [str , typing .Any ]:
218+ def template_variables (self ) -> dict [str , typing .Any ]:
219219 return dict (
220220 find_links = [
221221 link .strip ()
@@ -240,17 +240,17 @@ class Makefile(Template):
240240 def __init__ (
241241 self ,
242242 target_folder : Path ,
243- domains : typing . List [Domain ],
244- domain_settings : typing . Dict [str , str ],
245- environment : typing . Union [ Environment , None ] = None ,
243+ domains : list [Domain ],
244+ domain_settings : dict [str , str ],
245+ environment : Environment | None = None ,
246246 ) -> None :
247247 super ().__init__ (environment )
248248 self .target_folder = target_folder
249249 self .domains = domains
250250 self .domain_settings = domain_settings
251251
252252 @property
253- def template_variables (self ) -> typing . Dict [str , typing .Any ]:
253+ def template_variables (self ) -> dict [str , typing .Any ]:
254254 # collect domain settings
255255 settings = []
256256 for domain in self .domains :
@@ -301,8 +301,8 @@ class AdditionalSourcesTargets(Template):
301301
302302 def __init__ (
303303 self ,
304- additional_sources_targets : typing . List [str ],
305- environment : typing . Union [ Environment , None ] = None ,
304+ additional_sources_targets : list [str ],
305+ environment : Environment | None = None ,
306306 ) -> None :
307307 super ().__init__ (environment )
308308 self .additional_sources_targets = additional_sources_targets
@@ -312,7 +312,7 @@ def target_folder(self) -> Path:
312312 return mxmake_files ()
313313
314314 @property
315- def template_variables (self ) -> typing . Dict [str , typing .Any ]:
315+ def template_variables (self ) -> dict [str , typing .Any ]:
316316 return dict (additional_sources_targets = self .additional_sources_targets )
317317
318318
@@ -331,15 +331,15 @@ class MxIni(Template):
331331 def __init__ (
332332 self ,
333333 target_folder : Path ,
334- domains : typing . List [Domain ],
335- environment : typing . Union [ Environment , None ] = None ,
334+ domains : list [Domain ],
335+ environment : Environment | None = None ,
336336 ) -> None :
337337 super ().__init__ (environment )
338338 self .target_folder = target_folder
339339 self .domains = domains
340340
341341 @property
342- def template_variables (self ) -> typing . Dict [str , typing .Any ]:
342+ def template_variables (self ) -> dict [str , typing .Any ]:
343343 mxmake_templates = []
344344 mxmake_env = False
345345 for domain in self .domains :
@@ -375,7 +375,7 @@ class Topics(Template):
375375 target_folder = Path ()
376376
377377 @property
378- def template_variables (self ) -> typing . Dict [str , typing .Any ]:
378+ def template_variables (self ) -> dict [str , typing .Any ]:
379379 topics = load_topics ()
380380 return {"topics" : topics }
381381
@@ -404,7 +404,7 @@ class Dependencies(Template):
404404 target_folder = Path ()
405405
406406 @property
407- def template_variables (self ) -> typing . Dict [str , typing .Any ]:
407+ def template_variables (self ) -> dict [str , typing .Any ]:
408408 topics = load_topics ()
409409 return {"topics" : topics }
410410
@@ -426,12 +426,12 @@ def write(self) -> None:
426426
427427
428428class ci_template :
429- templates : typing . List = list ()
429+ templates : list = list ()
430430
431431 def __init__ (self , name : str ) -> None :
432432 self .name = name
433433
434- def __call__ (self , ob : typing . Type ["Template" ]) -> typing . Type ["Template" ]:
434+ def __call__ (self , ob : type ["Template" ]) -> type ["Template" ]:
435435 template (self .name )(ob )
436436 self .templates .append (self .name )
437437 return ob
0 commit comments