Skip to content

Commit 931016d

Browse files
authored
Merge pull request #43 from jkowalleck/improv-conda-typehints
fixed typehints/docs in `_BaseCondaParser`
2 parents 7f28bef + af6ddfd commit 931016d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

cyclonedx/parser/conda.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,15 @@ def __init__(self, conda_data: str):
3838
self._conda_packages_to_components()
3939

4040
@abstractmethod
41-
def _parse_to_conda_packages(self, data_str: str):
41+
def _parse_to_conda_packages(self, data_str: str) -> None:
4242
"""
43-
Abstract method for implementation by concrete Conda Parsers
43+
Abstract method for implementation by concrete Conda Parsers.
44+
45+
Implementation should add a `list` of `CondaPackage` instances to `self._conda_packages`
4446
4547
Params:
4648
data_str:
4749
`str` data passed into the Parser
48-
49-
Returns:
50-
A `list` of `CondaPackage` instances parsed.
5150
"""
5251
pass
5352

@@ -74,7 +73,7 @@ class CondaListJsonParser(_BaseCondaParser):
7473
This parser is intended to receive the output from the command `conda list --json`.
7574
"""
7675

77-
def _parse_to_conda_packages(self, data_str: str):
76+
def _parse_to_conda_packages(self, data_str: str) -> None:
7877
conda_list_content = json.loads(data_str)
7978

8079
for package in conda_list_content:
@@ -89,7 +88,7 @@ class CondaListExplicitParser(_BaseCondaParser):
8988
`conda list --explicit --md5`.
9089
"""
9190

92-
def _parse_to_conda_packages(self, data_str: str):
91+
def _parse_to_conda_packages(self, data_str: str) -> None:
9392
for line in data_str.replace('\r\n', '\n').split('\n'):
9493
line = line.strip()
9594
conda_package = parse_conda_list_str_to_conda_package(conda_list_str=line)

0 commit comments

Comments
 (0)