@@ -36,7 +36,9 @@ class ProjectBuilder:
3636 def __init__ (self , configuration : ProjectConfiguration ) -> None :
3737 self .configuration = configuration
3838
39- def gather_plugins (self , plugin_type : Type [Plugin ]) -> list [Type [Plugin ]]:
39+ DerivedPlugin = TypeVar ("DerivedPlugin" , bound = Plugin )
40+
41+ def gather_plugins (self , plugin_type : Type [DerivedPlugin ]) -> list [Type [DerivedPlugin ]]:
4042 """
4143 TODO
4244 """
@@ -50,29 +52,29 @@ def gather_plugins(self, plugin_type: Type[Plugin]) -> list[Type[Plugin]]:
5052
5153 return plugins
5254
53- def generate_model (self , plugins : list [Type [Plugin ]]) -> Type [PyProject ]:
55+ def generate_model (self , plugins : list [Type [Generator ]]) -> Type [PyProject ]:
5456 """
5557 TODO
5658 """
5759 plugin_fields = {}
5860 for plugin_type in plugins :
5961 plugin_fields [plugin_type .name ()] = plugin_type .data_type ()
6062
61- ExtendedCPPythonData = create_model (
63+ extended_cppython_type = create_model (
6264 "ExtendedCPPythonData" ,
6365 ** plugin_fields ,
6466 __base__ = CPPythonData ,
6567 )
6668
67- ExtendedToolData = create_model (
69+ extended_tool_type = create_model (
6870 "ToolData" ,
69- cppython = ExtendedCPPythonData ,
71+ cppython = extended_cppython_type ,
7072 __base__ = ToolData ,
7173 )
7274
7375 return create_model (
7476 "PyProject" ,
75- tool = ExtendedToolData ,
77+ tool = extended_tool_type ,
7678 __base__ = PyProject ,
7779 )
7880
@@ -110,8 +112,8 @@ def __init__(
110112 interface .print ("No generator plugin was found." )
111113 return
112114
113- ExtendedPyProject = builder .generate_model (plugins )
114- pyproject = ExtendedPyProject (** pyproject_data )
115+ extended_pyproject_type = builder .generate_model (plugins )
116+ pyproject = extended_pyproject_type (** pyproject_data )
115117
116118 if pyproject .tool is None :
117119 if self .configuration .verbose :
0 commit comments