Skip to content

Commit 6f34684

Browse files
authored
Reorder Core Data Generation (#103)
1 parent 448bd7a commit 6f34684

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

cppython/project.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,26 +45,29 @@ def __init__(
4545

4646
builder = Builder(self.logger)
4747

48-
self._core_data = builder.generate_core_data(configuration, pyproject.project, pyproject.tool.cppython)
49-
5048
raw_generator_plugins = builder.find_generators()
5149
generator_plugins = builder.filter_plugins(
5250
raw_generator_plugins,
53-
self.core_data.project_data.pyproject_file.parent,
54-
self.core_data.cppython_data.generator_name,
51+
configuration.pyproject_file.parent,
52+
pyproject.tool.cppython.generator_name,
5553
"Generator",
5654
)
5755

5856
raw_provider_plugins = builder.find_providers()
5957
provider_plugins = builder.filter_plugins(
6058
raw_provider_plugins,
61-
self.core_data.project_data.pyproject_file.parent,
62-
self.core_data.cppython_data.provider_name,
59+
configuration.pyproject_file.parent,
60+
pyproject.tool.cppython.provider_name,
6361
"Provider",
6462
)
6563

64+
# Solve the messy interactions between plugins
6665
generator_type, provider_type = builder.solve(generator_plugins, provider_plugins)
6766

67+
# 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)
69+
70+
# Create the chosen plugins
6871
self._generator = builder.create_generator(
6972
self.core_data, pyproject.tool.cppython.generator, generator_type
7073
)
@@ -92,10 +95,10 @@ def enabled(self) -> bool:
9295

9396
@property
9497
def core_data(self) -> CoreData:
95-
"""Queries if the project was is initialized for full functionality
98+
"""Core data
9699
97100
Returns:
98-
The query result
101+
Core data
99102
"""
100103
return self._core_data
101104

0 commit comments

Comments
 (0)