66from typing import Any
77
88from cppython_core .exceptions import ConfigError , PluginError
9- from cppython_core .resolution import resolve_name
9+ from cppython_core .resolution import PluginBuildData , resolve_name
1010from cppython_core .schema import CoreData , Interface , ProjectConfiguration , PyProject
1111from pydantic import ValidationError
1212
@@ -34,14 +34,7 @@ def __init__(
3434 self .logger .info ("Initializing project" )
3535
3636 try :
37- if (pyproject := PyProject (** pyproject_data )) is None :
38- raise ConfigError ("Table [project] is not defined" )
39-
40- if pyproject .tool is None :
41- raise ConfigError ("Table [tool] is not defined" )
42-
43- if pyproject .tool .cppython is None :
44- raise ConfigError ("Table [tool.cppython] is not defined" )
37+ pyproject = PyProject (** pyproject_data )
4538
4639 builder = Builder (self .logger )
4740
@@ -64,8 +57,12 @@ def __init__(
6457 # Solve the messy interactions between plugins
6558 generator_type , provider_type = builder .solve (generator_plugins , provider_plugins )
6659
60+ pyproject_build_data = PluginBuildData (generator_type = generator_type , provider_type = provider_type )
61+
6762 # Once the plugins are resolved, the core data is complete and can be generated
68- self ._core_data = builder .generate_core_data (configuration , pyproject .project , pyproject .tool .cppython )
63+ self ._core_data = builder .generate_core_data (
64+ configuration , pyproject .project , pyproject .tool .cppython , pyproject_build_data
65+ )
6966
7067 # Create the chosen plugins
7168 self ._generator = builder .create_generator (
0 commit comments