Skip to content

Commit bca9487

Browse files
committed
fixed issue with CSV generation
1 parent f9d8523 commit bca9487

File tree

3 files changed

+35
-11
lines changed

3 files changed

+35
-11
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
### Added
1010
- Upcoming changes...
1111

12+
## [1.6.1] - 2023-07-06
13+
### Fixed
14+
- Fixed issue with CSV dependency generation
15+
- Increased `scanoss-winnowing` minimum requirement to match HPSM support
16+
1217
## [1.6.0] - 2023-06-16
1318
### Added
1419
- Added support for High Precision Snippet Matching (`--hpsm` or `-H`) while scanning
@@ -242,3 +247,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
242247
[1.5.0]: https://github.com/scanoss/scanoss.py/compare/v1.4.2...v1.5.0
243248
[1.5.1]: https://github.com/scanoss/scanoss.py/compare/v1.5.0...v1.5.1
244249
[1.5.2]: https://github.com/scanoss/scanoss.py/compare/v1.5.1...v1.5.2
250+
[1.6.0]: https://github.com/scanoss/scanoss.py/compare/v1.5.2...v1.6.0
251+
[1.6.1]: https://github.com/scanoss/scanoss.py/compare/v1.6.0...v1.6.1

src/scanoss/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
THE SOFTWARE.
2323
"""
2424

25-
__version__ = '1.6.0'
25+
__version__ = '1.6.1'

src/scanoss/csvoutput.py

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ def parse(self, data: json):
7272
self.print_stderr(f'Warning: No Dependencies found for {f}: {file_details}')
7373
continue
7474
for deps in dependencies:
75+
detected = {}
7576
purl = deps.get("purl")
7677
if not purl:
7778
self.print_stderr(f'Warning: No PURL found for {f}: {deps}')
@@ -90,6 +91,19 @@ def parse(self, data: json):
9091
detected['licenses'] = ''
9192
else:
9293
detected['licenses'] = ';'.join(dc)
94+
# inventory_id,path,usage,detected_component,detected_license,detected_version,detected_latest,purl
95+
csv_dict.append({'inventory_id': row_id, 'path': f, 'detected_usage': id_details,
96+
'detected_component': detected.get('component'),
97+
'detected_license': detected.get('licenses'),
98+
'detected_version': detected.get('version'),
99+
'detected_latest': detected.get('latest'),
100+
'detected_purls': detected.get('purls'),
101+
'detected_url': detected.get('url'),
102+
'detected_path': detected.get('file', ''),
103+
'detected_match': matched, 'detected_lines': lines,
104+
'detected_oss_lines': oss_lines
105+
})
106+
row_id = row_id + 1
93107
else:
94108
purls = d.get('purl')
95109
if not purls:
@@ -116,16 +130,19 @@ def parse(self, data: json):
116130
detected['licenses'] = ''
117131
else:
118132
detected['licenses'] = ';'.join(dc)
119-
# inventory_id,path,usage,detected_component,detected_license,detected_version,detected_latest,purl
120-
csv_dict.append({'inventory_id': row_id, 'path': f, 'detected_usage': id_details,
121-
'detected_component': detected.get('component'),
122-
'detected_license': detected.get('licenses'),
123-
'detected_version': detected.get('version'), 'detected_latest': detected.get('latest'),
124-
'detected_purls': detected.get('purls'), 'detected_url': detected.get('url'),
125-
'detected_path': detected.get('file', ''),
126-
'detected_match': matched, 'detected_lines': lines, 'detected_oss_lines': oss_lines
127-
})
128-
row_id = row_id + 1
133+
# inventory_id,path,usage,detected_component,detected_license,detected_version,detected_latest,purl
134+
csv_dict.append({'inventory_id': row_id, 'path': f, 'detected_usage': id_details,
135+
'detected_component': detected.get('component'),
136+
'detected_license': detected.get('licenses'),
137+
'detected_version': detected.get('version'),
138+
'detected_latest': detected.get('latest'),
139+
'detected_purls': detected.get('purls'),
140+
'detected_url': detected.get('url'),
141+
'detected_path': detected.get('file', ''),
142+
'detected_match': matched, 'detected_lines': lines,
143+
'detected_oss_lines': oss_lines
144+
})
145+
row_id = row_id + 1
129146
return csv_dict
130147

131148
def produce_from_file(self, json_file: str, output_file: str = None) -> bool:

0 commit comments

Comments
 (0)