44from pathlib import Path
55from typing import Any , cast
66
7+ from packaging .requirements import InvalidRequirement , Requirement
78from pydantic import BaseModel , DirectoryPath , ValidationError
89
910from cppython .core .exception import ConfigException
@@ -149,6 +150,15 @@ def resolve_cppython(
149150
150151 modified_scm_name = plugin_build_data .scm_name
151152
153+ # Construct dependencies from the local configuration only
154+ dependencies : list [Requirement ] = []
155+ if local_configuration .dependencies :
156+ for dependency in local_configuration .dependencies :
157+ try :
158+ dependencies .append (Requirement (dependency ))
159+ except InvalidRequirement as error :
160+ raise ConfigException (f"Invalid requirement '{ dependency } ' in dependencies: { error } " , []) from error
161+
152162 cppython_data = CPPythonData (
153163 configuration_path = modified_configuration_path ,
154164 install_path = modified_install_path ,
@@ -158,7 +168,7 @@ def resolve_cppython(
158168 provider_name = modified_provider_name ,
159169 generator_name = modified_generator_name ,
160170 scm_name = modified_scm_name ,
161- dependencies = [] ,
171+ dependencies = dependencies ,
162172 )
163173 return cppython_data
164174
@@ -185,7 +195,7 @@ def resolve_cppython_plugin(cppython_data: CPPythonData, plugin_type: type[Plugi
185195 provider_name = cppython_data .provider_name ,
186196 generator_name = cppython_data .generator_name ,
187197 scm_name = cppython_data .scm_name ,
188- dependencies = [] ,
198+ dependencies = cppython_data . dependencies ,
189199 )
190200
191201 return cast (CPPythonPluginData , plugin_data )
0 commit comments