fosslight-dependency 4.1.2__py3-none-any.whl → 4.1.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fosslight_dependency/run_dependency_scanner.py +43 -14
- {fosslight_dependency-4.1.2.dist-info → fosslight_dependency-4.1.3.dist-info}/METADATA +3 -3
- {fosslight_dependency-4.1.2.dist-info → fosslight_dependency-4.1.3.dist-info}/RECORD +10 -10
- {fosslight_dependency-4.1.2.dist-info → fosslight_dependency-4.1.3.dist-info}/WHEEL +1 -1
- {fosslight_dependency-4.1.2.dist-info → fosslight_dependency-4.1.3.dist-info}/Apache-2.0.txt +0 -0
- {fosslight_dependency-4.1.2.dist-info → fosslight_dependency-4.1.3.dist-info}/LICENSE +0 -0
- {fosslight_dependency-4.1.2.dist-info → fosslight_dependency-4.1.3.dist-info}/LicenseRef-3rd_party_licenses.txt +0 -0
- {fosslight_dependency-4.1.2.dist-info → fosslight_dependency-4.1.3.dist-info}/MIT.txt +0 -0
- {fosslight_dependency-4.1.2.dist-info → fosslight_dependency-4.1.3.dist-info}/entry_points.txt +0 -0
- {fosslight_dependency-4.1.2.dist-info → fosslight_dependency-4.1.3.dist-info}/top_level.txt +0 -0
@@ -11,6 +11,7 @@ import pkg_resources
|
|
11
11
|
import warnings
|
12
12
|
from datetime import datetime
|
13
13
|
import logging
|
14
|
+
import shutil
|
14
15
|
import fosslight_dependency.constant as const
|
15
16
|
from collections import defaultdict
|
16
17
|
from fosslight_util.set_log import init_log
|
@@ -30,12 +31,26 @@ EXTENDED_HEADER = {_sheet_name: ['ID', 'Package URL', 'OSS Name',
|
|
30
31
|
'OSS Version', 'License', 'Download Location',
|
31
32
|
'Homepage', 'Copyright Text', 'Exclude',
|
32
33
|
'Comment', 'Depends On']}
|
33
|
-
CUSTOMIZED_FORMAT = {'excel': '.xlsx', 'csv': '.csv', 'opossum': '.json', 'yaml': '.yaml',
|
34
|
-
'spdx-yaml': '.yaml', 'spdx-json': '.json', 'spdx-xml': '.xml',
|
35
|
-
'spdx-tag': '.tag'}
|
36
34
|
_exclude_dir = ['node_moduels', 'venv']
|
37
35
|
|
38
36
|
|
37
|
+
def get_terminal_size():
|
38
|
+
size = shutil.get_terminal_size()
|
39
|
+
return size.lines
|
40
|
+
|
41
|
+
|
42
|
+
def paginate_file(file_path):
|
43
|
+
lines_per_page = get_terminal_size() - 1
|
44
|
+
with open(file_path, 'r', encoding='utf8') as file:
|
45
|
+
lines = file.readlines()
|
46
|
+
|
47
|
+
for i in range(0, len(lines), lines_per_page):
|
48
|
+
os.system('clear' if os.name == 'posix' else 'cls')
|
49
|
+
print(''.join(lines[i: i + lines_per_page]))
|
50
|
+
if i + lines_per_page < len(lines):
|
51
|
+
input("Press Enter to see the next page...")
|
52
|
+
|
53
|
+
|
39
54
|
def find_package_manager(input_dir, abs_path_to_exclude=[]):
|
40
55
|
ret = True
|
41
56
|
manifest_file_name = []
|
@@ -113,12 +128,15 @@ def run_dependency_scanner(package_manager='', input_dir='', output_dir_file='',
|
|
113
128
|
to_remove = [] # elements of spdx format on windows that should be removed
|
114
129
|
for i, output_extension in enumerate(output_extensions):
|
115
130
|
if formats:
|
116
|
-
if formats[i].startswith('spdx'):
|
117
|
-
if platform.system()
|
118
|
-
|
119
|
-
else:
|
120
|
-
logger.warning('spdx format is not supported on Windows. Please remove spdx from format.')
|
131
|
+
if formats[i].startswith('spdx') or formats[i].startswith('cyclonedx'):
|
132
|
+
if platform.system() == 'Windows':
|
133
|
+
logger.warning(f'{formats[i]} is not supported on Windows.Please remove {formats[i]} from format.')
|
121
134
|
to_remove.append(i)
|
135
|
+
else:
|
136
|
+
if formats[i].stasrtswith('spdx'):
|
137
|
+
output_files[i] = f"fosslight_spdx_dep_{_start_time}"
|
138
|
+
elif formats[i].startswith('cyclonedx'):
|
139
|
+
output_files[i] = f'fosslight_cyclonedx_dep_{_start_time}'
|
122
140
|
else:
|
123
141
|
if output_extension == _json_ext:
|
124
142
|
output_files[i] = f"fosslight_opossum_dep_{_start_time}"
|
@@ -220,7 +238,8 @@ def run_dependency_scanner(package_manager='', input_dir='', output_dir_file='',
|
|
220
238
|
if len(success_pm) > 0:
|
221
239
|
scan_item.set_cover_comment(f"Analyzed Package manager: {', '.join(success_pm)}")
|
222
240
|
if len(fail_pm) > 0:
|
223
|
-
info_msg = 'Check
|
241
|
+
info_msg = 'Check log file(fosslight_log*.txt) ' \
|
242
|
+
'and https://fosslight.org/fosslight-guide-en/scanner/3_dependency.html#-prerequisite.'
|
224
243
|
scan_item.set_cover_comment(f"Analysis failed Package manager: {', '.join(fail_pm)} ({info_msg})")
|
225
244
|
else:
|
226
245
|
scan_item.set_cover_comment("No Package manager detected.")
|
@@ -229,7 +248,15 @@ def run_dependency_scanner(package_manager='', input_dir='', output_dir_file='',
|
|
229
248
|
graph_path = os.path.abspath(graph_path)
|
230
249
|
try:
|
231
250
|
converter = GraphConvertor(scan_item.file_items[_PKG_NAME])
|
232
|
-
|
251
|
+
growth_factor_per_node = 10
|
252
|
+
node_count_threshold = 20
|
253
|
+
node_count = len(scan_item.file_items[_PKG_NAME])
|
254
|
+
if node_count > node_count_threshold:
|
255
|
+
new_size = tuple(x + (node_count * growth_factor_per_node) for x in graph_size)
|
256
|
+
else:
|
257
|
+
new_size = graph_size
|
258
|
+
new_size = tuple((((x + 99) // 100) * 100) for x in new_size)
|
259
|
+
converter.save(graph_path, new_size)
|
233
260
|
logger.info(f"Output graph image file: {graph_path}")
|
234
261
|
except Exception as e:
|
235
262
|
logger.error(f'Fail to make graph image: {e}')
|
@@ -326,9 +353,9 @@ def main():
|
|
326
353
|
if args.graph_size:
|
327
354
|
graph_size = args.graph_size
|
328
355
|
if args.direct: # --direct option
|
329
|
-
if args.direct == 'true':
|
356
|
+
if args.direct == 'true' or args.direct == 'True':
|
330
357
|
direct = True
|
331
|
-
elif args.direct == 'false':
|
358
|
+
elif args.direct == 'false' or args.direct == 'False':
|
332
359
|
direct = False
|
333
360
|
if args.notice: # --notice option
|
334
361
|
try:
|
@@ -339,8 +366,10 @@ def main():
|
|
339
366
|
data_path = os.path.join(base_path, 'LICENSES')
|
340
367
|
print(f"*** {_PKG_NAME} open source license notice ***")
|
341
368
|
for ff in os.listdir(data_path):
|
342
|
-
|
343
|
-
|
369
|
+
source_file = os.path.join(data_path, ff)
|
370
|
+
destination_file = os.path.join(base_path, ff)
|
371
|
+
paginate_file(source_file)
|
372
|
+
shutil.copyfile(source_file, destination_file)
|
344
373
|
sys.exit(0)
|
345
374
|
|
346
375
|
run_dependency_scanner(package_manager, input_dir, output_dir, pip_activate_cmd, pip_deactivate_cmd,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: fosslight-dependency
|
3
|
-
Version: 4.1.
|
3
|
+
Version: 4.1.3
|
4
4
|
Summary: FOSSLight Dependency Scanner
|
5
5
|
Home-page: https://github.com/fosslight/fosslight_dependency_scanner
|
6
6
|
Author: LG Electronics
|
@@ -20,7 +20,7 @@ Requires-Dist: lxml
|
|
20
20
|
Requires-Dist: virtualenv
|
21
21
|
Requires-Dist: pyyaml
|
22
22
|
Requires-Dist: lastversion
|
23
|
-
Requires-Dist: fosslight-util>=2.1.
|
23
|
+
Requires-Dist: fosslight-util>=2.1.6
|
24
24
|
Requires-Dist: PyGithub
|
25
25
|
Requires-Dist: requirements-parser
|
26
26
|
Requires-Dist: defusedxml
|
@@ -35,7 +35,7 @@ SPDX-License-Identifier: Apache-2.0
|
|
35
35
|
|
36
36
|
# FOSSLight Dependency Scanner
|
37
37
|
|
38
|
-
|
38
|
+
<img src="https://img.shields.io/pypi/l/fosslight_dependency" alt="License" /> <a href="https://pypi.org/project/fosslight-dependency/"><img src="https://img.shields.io/pypi/v/fosslight_dependency" alt="Current python package version." /></a> <img src="https://img.shields.io/pypi/pyversions/fosslight_dependency" /> [](https://api.reuse.software/info/github.com/fosslight/fosslight_dependency_scanner)
|
39
39
|
|
40
40
|
## 💡 Introduction
|
41
41
|
|
@@ -5,7 +5,7 @@ fosslight_dependency/_help.py,sha256=INeP24fFfV2HPhZJMqk_KCu08X7nneAumBqMWQ7Sbw8
|
|
5
5
|
fosslight_dependency/_package_manager.py,sha256=TDYP0tlqr7A346BoC2EKEZSq7Eua2cWdJQ5YvMIc9Wc,17265
|
6
6
|
fosslight_dependency/constant.py,sha256=FAkzrW1S6Ua_TAbvQ2y6d0dhEZcgonB11miKUj7lB98,1080
|
7
7
|
fosslight_dependency/dependency_item.py,sha256=wNLWcsNycf3HQ5Pib2WrMeo2dn0eHCRg20NLcL95Qew,3345
|
8
|
-
fosslight_dependency/run_dependency_scanner.py,sha256=
|
8
|
+
fosslight_dependency/run_dependency_scanner.py,sha256=Za6VeJnTxoksD2wCUPhO7JPgDNkLTaZMmJk6FRjNOAk,16472
|
9
9
|
fosslight_dependency/LICENSES/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
10
10
|
fosslight_dependency/LICENSES/LicenseRef-3rd_party_licenses.txt,sha256=EcsFt7aE1rp3OXAdJgmXayfOZdpRdBMcmRnyoqWMCsw,95687
|
11
11
|
fosslight_dependency/package_manager/Android.py,sha256=0UZFvbLxDIreerK4fR316YPyhUpPliV_kfZulrxkUyo,3218
|
@@ -26,12 +26,12 @@ fosslight_dependency/package_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeu
|
|
26
26
|
fosslight_dependency/third_party/askalono/askalono.exe,sha256=NyngElHbrg3zLFRVwn6fPDZE_EDAEb1N8tiwWoCm4pQ,4743680
|
27
27
|
fosslight_dependency/third_party/askalono/askalono_macos,sha256=cYSNXhAQpkdd8lkgnY5skNeDmU_8DIuP84eFi0OXKkE,5589868
|
28
28
|
fosslight_dependency/third_party/nomos/nomossa,sha256=oFF9I-fhug6AVNyFnWeVXwDRin6NWSvk1g7mHBotB3Q,866408
|
29
|
-
fosslight_dependency-4.1.
|
30
|
-
fosslight_dependency-4.1.
|
31
|
-
fosslight_dependency-4.1.
|
32
|
-
fosslight_dependency-4.1.
|
33
|
-
fosslight_dependency-4.1.
|
34
|
-
fosslight_dependency-4.1.
|
35
|
-
fosslight_dependency-4.1.
|
36
|
-
fosslight_dependency-4.1.
|
37
|
-
fosslight_dependency-4.1.
|
29
|
+
fosslight_dependency-4.1.3.dist-info/Apache-2.0.txt,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
30
|
+
fosslight_dependency-4.1.3.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
31
|
+
fosslight_dependency-4.1.3.dist-info/LicenseRef-3rd_party_licenses.txt,sha256=EcsFt7aE1rp3OXAdJgmXayfOZdpRdBMcmRnyoqWMCsw,95687
|
32
|
+
fosslight_dependency-4.1.3.dist-info/METADATA,sha256=Kea3nRexUXBq4K2rxAJpNhrrqTLPDcTPmm0UOn1c5wc,4956
|
33
|
+
fosslight_dependency-4.1.3.dist-info/MIT.txt,sha256=9cx4CbArgByWvkoEZNqpzbpJgA9TUe2D62rMocQpgfs,1082
|
34
|
+
fosslight_dependency-4.1.3.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
35
|
+
fosslight_dependency-4.1.3.dist-info/entry_points.txt,sha256=e1QZbnCrQvfbwe9L6PxXnkRZMhl-PSo0QyUes0dGjU8,91
|
36
|
+
fosslight_dependency-4.1.3.dist-info/top_level.txt,sha256=Jc0V7VcVCH0TEM8ksb8dwroTYz4AmRaQnlr3FB71Hcs,21
|
37
|
+
fosslight_dependency-4.1.3.dist-info/RECORD,,
|
{fosslight_dependency-4.1.2.dist-info → fosslight_dependency-4.1.3.dist-info}/Apache-2.0.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{fosslight_dependency-4.1.2.dist-info → fosslight_dependency-4.1.3.dist-info}/entry_points.txt
RENAMED
File without changes
|
File without changes
|