Skip to content

Commit 590a432

Browse files
committed
Address Documentation TODOs
1 parent 3cba536 commit 590a432

4 files changed

Lines changed: 27 additions & 34 deletions

File tree

cppython/builder.py

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,18 @@ def generate_core_data(
8282
pep621_configuration: PEP621Configuration,
8383
cppython_configuration: CPPythonLocalConfiguration,
8484
) -> CoreData:
85-
"""_summary_
85+
"""Parses and returns resolved data from all configuration sources
8686
8787
Args:
88-
self: _description_
89-
configuration: TODO
90-
pep621_configuration: TODO
91-
cppython_configuration: TODO
88+
configuration: Input configuration
89+
pep621_configuration: Project table configuration
90+
cppython_configuration: Tool configuration
9291
9392
Raises:
9493
ConfigError: Raised if data cannot be parsed
9594
9695
Returns:
97-
_description_
96+
The resolved core object
9897
"""
9998

10099
global_configuration = CPPythonGlobalConfiguration()
@@ -113,21 +112,20 @@ def generate_core_data(
113112
return CoreData(project_data=project_data, pep621_data=pep621_data, cppython_data=cppython_data)
114113

115114
def extract_vcs_version(self, path: Path) -> str:
116-
"""_summary_
115+
"""Locates an available VCS plugin that can report version information about the given path
117116
118117
Args:
119-
path: _description_
118+
path: The directory to query
120119
121120
Raises:
122-
TypeError: _description_
123-
TypeError: _description_
121+
PluginError: If no VCS plugin can be found
124122
125123
Returns:
126-
_description_
124+
A version token
127125
"""
128126

129127
if not (vcs_types := self.discover_vcs()):
130-
raise TypeError("No VCS plugin found")
128+
raise PluginError("No VCS plugin found")
131129

132130
plugin = None
133131
for vcs_type in vcs_types:
@@ -137,7 +135,7 @@ def extract_vcs_version(self, path: Path) -> str:
137135
break
138136

139137
if not plugin:
140-
raise TypeError("No applicable VCS plugin found for the given path")
138+
raise PluginError("No applicable VCS plugin found for the given path")
141139

142140
return plugin.extract_version(path)
143141

@@ -216,18 +214,18 @@ def discover_vcs(self) -> list[type[VersionControl]]:
216214
def create_generator(
217215
self, plugin_types: list[type[GeneratorT]], core_data: CoreData, generator_configuration: dict[str, Any]
218216
) -> GeneratorT:
219-
"""_summary_
217+
"""Creates a generator from input configuration
220218
221219
Args:
222-
plugin_types: _description_
223-
core_data: _description_
224-
generator_configuration: TODO
220+
plugin_types: The list of generator types to query
221+
core_data: The resolved configuration data
222+
generator_configuration: The generator table of the CPPython configuration data
225223
226224
Raises:
227-
PluginError: TODO
225+
PluginError: Raised if no viable generator plugin was found
228226
229227
Returns:
230-
_description_
228+
The constructed generator
231229
"""
232230

233231
directory = core_data.project_data.pyproject_file.parent
@@ -275,12 +273,12 @@ def create_providers(
275273
"""Creates Providers from input data
276274
277275
Args:
278-
plugin_types: TODO
279-
core_data: TODO
280-
provider_configuration: TODO
276+
plugin_types: The discovered provider plugin types
277+
core_data: The resolved configuration data
278+
provider_configuration: The provider data table
281279
282280
Returns:
283-
TODO
281+
A list of constructed provider plugins
284282
"""
285283

286284
plugins = []

cppython/console/interface.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ def query_vcs(self) -> str:
5656
return "TODO"
5757

5858
def generate_project(self) -> Project:
59-
"""_summary_
59+
"""Aids in project generation. Allows deferred configuration from within the "config" object
6060
6161
Returns:
62-
_description_
62+
The constructed Project
6363
"""
6464

6565
pyproject_data = tomlkit.loads(self.configuration.pyproject_file.read_text(encoding="utf-8"))

cppython/project.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,7 @@ async def download_provider_tools(self) -> None:
107107
self.logger.info("The %s provider is already downloaded", provider.name())
108108

109109
def sync(self) -> None:
110-
"""_summary_
111-
112-
Raises:
113-
exception: _description_
114-
exception: _description_
115-
"""
110+
"""Gathers sync information from providers and passes it to the generator"""
116111

117112
inputs = []
118113
for provider in self._providers:

tests/unit/test_project.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ def test_provider_creation(
9191
"""Test that providers can be created with the mock data available
9292
9393
Args:
94-
core_data: TODO
95-
project_with_mocks: Local config
94+
core_data: The resolved configuration data
95+
project_with_mocks: Data with mocks attached
9696
"""
9797

9898
builder = Builder(getLogger())
@@ -115,7 +115,7 @@ def test_generator_creation(
115115
"""Test that providers can be created with the mock data available
116116
117117
Args:
118-
core_data: TODO
118+
core_data: The resolved configuration data
119119
project_with_mocks: Local config
120120
"""
121121

0 commit comments

Comments
 (0)