fosslight-scanner 2.1.9__py3-none-any.whl → 2.1.10__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.
@@ -40,13 +40,14 @@ _HELP_MESSAGE_SCANNER = """
40
40
  --no_correction\t Enter if you don't want to correct OSS information with sbom-info.yaml
41
41
  * Correction mode only supported xlsx format.
42
42
  --correct_fpath <path> Path to the sbom-info.yaml file
43
- --ui\t\t\t Generate UI mode result file
43
+ --ui\t\t Generate UI mode result file
44
+ --recursive_dep\t Recursively analyze dependencies
44
45
 
45
46
  Options for only 'all' or 'bin' mode
46
47
  -u <db_url>\t\t DB Connection(format :'postgresql://username:password@host:port/database_name')
47
48
 
48
49
  Options for only 'all' or 'dependency' mode
49
- -d <dependency_argument>\t Additional arguments for running dependency analysis"""
50
+ -d <dependency_arg>\t Additional arguments for running dependency analysis"""
50
51
 
51
52
 
52
53
  def print_help_msg():
@@ -25,12 +25,13 @@ def parse_setting_json(data):
25
25
  source_print_matched_text = data.get('source_print_matched_text', False)
26
26
  source_time_out = data.get('source_time_out', 120)
27
27
  binary_simple = data.get('binary_simple', False)
28
+ recursive_dep = data.get('recursive_dep', False)
28
29
  str_lists = [mode, path, exclude_path]
29
30
  strings = [
30
31
  dep_argument, output, format, db_url,
31
32
  correct_fpath, link, selected_source_scanner
32
33
  ]
33
- booleans = [timer, raw, no_correction, ui, source_write_json_file, source_print_matched_text, binary_simple]
34
+ booleans = [timer, raw, no_correction, ui, source_write_json_file, source_print_matched_text, binary_simple, recursive_dep]
34
35
 
35
36
  is_incorrect = False
36
37
 
@@ -65,4 +66,4 @@ def parse_setting_json(data):
65
66
  return mode, path, dep_argument, output, format, link, db_url, timer, \
66
67
  raw, core, no_correction, correct_fpath, ui, exclude_path, \
67
68
  selected_source_scanner, source_write_json_file, source_print_matched_text, source_time_out, \
68
- binary_simple
69
+ binary_simple, recursive_dep
fosslight_scanner/cli.py CHANGED
@@ -15,7 +15,8 @@ from fosslight_util.help import print_package_version
15
15
 
16
16
 
17
17
  def set_args(mode, path, dep_argument, output, format, link, db_url, timer,
18
- raw, core, no_correction, correct_fpath, ui, setting, exclude_path):
18
+ raw, core, no_correction, correct_fpath, ui, setting, exclude_path,
19
+ recursive_dep):
19
20
 
20
21
  selected_source_scanner = "all"
21
22
  source_write_json_file = False
@@ -30,7 +31,7 @@ def set_args(mode, path, dep_argument, output, format, link, db_url, timer,
30
31
  s_mode, s_path, s_dep_argument, s_output, s_format, s_link, s_db_url, s_timer, s_raw, s_core, \
31
32
  s_no_correction, s_correct_fpath, s_ui, s_exclude_path, \
32
33
  s_selected_source_scanner, s_source_write_json_file, s_source_print_matched_text, \
33
- s_source_time_out, s_binary_simple = parse_setting_json(data)
34
+ s_source_time_out, s_binary_simple, s_recursive_dep = parse_setting_json(data)
34
35
 
35
36
  # direct cli arguments have higher priority than setting file
36
37
  mode = mode or s_mode
@@ -47,6 +48,7 @@ def set_args(mode, path, dep_argument, output, format, link, db_url, timer,
47
48
  correct_fpath = correct_fpath or s_correct_fpath
48
49
  ui = ui or s_ui
49
50
  exclude_path = exclude_path or s_exclude_path
51
+ recursive_dep = recursive_dep or s_recursive_dep
50
52
 
51
53
  # These options are only set from the setting file, not from CLI arguments
52
54
  selected_source_scanner = s_selected_source_scanner or selected_source_scanner
@@ -60,7 +62,7 @@ def set_args(mode, path, dep_argument, output, format, link, db_url, timer,
60
62
  return mode, path, dep_argument, output, format, link, db_url, timer, \
61
63
  raw, core, no_correction, correct_fpath, ui, exclude_path, \
62
64
  selected_source_scanner, source_write_json_file, source_print_matched_text, source_time_out, \
63
- binary_simple
65
+ binary_simple, recursive_dep
64
66
 
65
67
 
66
68
  def main():
@@ -79,7 +81,7 @@ def main():
79
81
  type=str, dest='format',nargs='*', default=[])
80
82
  parser.add_argument('--output', '-o', help='Output directory or file',
81
83
  type=str, dest='output', default="")
82
- parser.add_argument('--dependency', '-d', help='Dependency arguments',
84
+ parser.add_argument('--dependency', '-d', help='Dependency arguments (e.g. -d "-m pip" )',
83
85
  type=str, dest='dep_argument', default="")
84
86
  parser.add_argument('--url', '-u', help="DB Url",
85
87
  type=str, dest='db_url', default="")
@@ -105,6 +107,8 @@ def main():
105
107
  type=str, required=False, default='')
106
108
  parser.add_argument('--ui', help='Generate UI mode result file',
107
109
  action='store_true', required=False, default=False)
110
+ parser.add_argument('--recursive_dep', '-rd', help='Recursively analyze dependencies',
111
+ action='store_true', dest='recursive_dep', default=False)
108
112
 
109
113
  try:
110
114
  args = parser.parse_args()
@@ -118,16 +122,16 @@ def main():
118
122
  else:
119
123
  mode, path, dep_argument, output, format, link, db_url, timer, raw, core, no_correction, correct_fpath, \
120
124
  ui, exclude_path, selected_source_scanner, source_write_json_file, source_print_matched_text, \
121
- source_time_out, binary_simple, = set_args(
125
+ source_time_out, binary_simple, recursive_dep = set_args(
122
126
  args.mode, args.path, args.dep_argument, args.output,
123
127
  args.format, args.link, args.db_url, args.timer, args.raw,
124
128
  args.core, args.no_correction, args.correct_fpath, args.ui,
125
- args.setting, args.exclude_path)
129
+ args.setting, args.exclude_path, args.recursive_dep)
126
130
 
127
131
  run_main(mode, path, dep_argument, output, format, link, db_url, timer,
128
132
  raw, core, not no_correction, correct_fpath, ui, exclude_path,
129
133
  selected_source_scanner, source_write_json_file, source_print_matched_text,
130
- source_time_out, binary_simple)
134
+ source_time_out, binary_simple, recursive_dep)
131
135
 
132
136
 
133
137
  if __name__ == "__main__":
@@ -57,7 +57,8 @@ SCANNER_MODE = [
57
57
  ]
58
58
 
59
59
 
60
- def run_dependency(path_to_analyze, output_file_with_path, params="", path_to_exclude=[], formats=[]):
60
+ def run_dependency(path_to_analyze, output_file_with_path, params="", path_to_exclude=[], formats=[],
61
+ recursive_dep=False):
61
62
  result = []
62
63
 
63
64
  package_manager = ""
@@ -100,7 +101,9 @@ def run_dependency(path_to_analyze, output_file_with_path, params="", path_to_ex
100
101
  output_file_with_path,
101
102
  pip_activate_cmd, pip_deactivate_cmd,
102
103
  output_custom_dir, app_name,
103
- github_token, formats, True, path_to_exclude=path_to_exclude
104
+ github_token, formats, True, path_to_exclude=path_to_exclude,
105
+ graph_path="", graph_size=(600,600),
106
+ recursive=recursive_dep
104
107
  )
105
108
  if success:
106
109
  result = scan_item
@@ -131,7 +134,7 @@ def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
131
134
  default_oss_name="", default_oss_version="", url="",
132
135
  correct_mode=True, correct_fpath="", ui_mode=False, path_to_exclude=[],
133
136
  selected_source_scanner="all", source_write_json_file=False, source_print_matched_text=False,
134
- source_time_out=120, binary_simple=False, formats=[]):
137
+ source_time_out=120, binary_simple=False, formats=[], recursive_dep=False):
135
138
  final_excel_dir = output_path
136
139
  success = True
137
140
  all_cover_items = []
@@ -232,7 +235,8 @@ def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
232
235
 
233
236
  if run_dep:
234
237
  dep_scanitem = run_dependency(src_path, _output_dir,
235
- dep_arguments, path_to_exclude, formats)
238
+ dep_arguments, path_to_exclude, formats,
239
+ recursive_dep)
236
240
  all_scan_item.file_items.update(dep_scanitem.file_items)
237
241
  all_cover_items.append(dep_scanitem.cover)
238
242
  else:
@@ -359,7 +363,7 @@ def run_main(mode_list, path_arg, dep_arguments, output_file_or_dir, file_format
359
363
  db_url, hide_progressbar=False, keep_raw_data=False, num_cores=-1,
360
364
  correct_mode=True, correct_fpath="", ui_mode=False, path_to_exclude=[],
361
365
  selected_source_scanner="all", source_write_json_file=False, source_print_matched_text=False,
362
- source_time_out=120, binary_simple=False):
366
+ source_time_out=120, binary_simple=False, recursive_dep=False):
363
367
  global _executed_path, _start_time
364
368
 
365
369
  output_files = []
@@ -470,7 +474,7 @@ def run_main(mode_list, path_arg, dep_arguments, output_file_or_dir, file_format
470
474
  default_oss_name, default_oss_version, url_to_analyze,
471
475
  correct_mode, correct_fpath, ui_mode, path_to_exclude,
472
476
  selected_source_scanner, source_write_json_file, source_print_matched_text, source_time_out,
473
- binary_simple, formats)
477
+ binary_simple, formats, recursive_dep)
474
478
 
475
479
  if extract_folder:
476
480
  shutil.rmtree(extract_folder)
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
2
- Name: fosslight-scanner
3
- Version: 2.1.9
1
+ Metadata-Version: 2.4
2
+ Name: fosslight_scanner
3
+ Version: 2.1.10
4
4
  Summary: FOSSLight Scanner
5
5
  Home-page: https://github.com/fosslight/fosslight_scanner
6
6
  Download-URL: https://github.com/fosslight/fosslight_scanner
@@ -20,11 +20,22 @@ Requires-Dist: openpyxl
20
20
  Requires-Dist: progress
21
21
  Requires-Dist: pyyaml
22
22
  Requires-Dist: beautifulsoup4
23
- Requires-Dist: fosslight-util<3.0.0,>=2.1.12
24
- Requires-Dist: fosslight-source<3.0.0,>=2.1.12
25
- Requires-Dist: fosslight-dependency<5.0.0,>=4.1.3
26
- Requires-Dist: fosslight-binary<6.0.0,>=5.1.9
27
- Requires-Dist: fosslight-prechecker<5.0.0,>=4.0.0
23
+ Requires-Dist: fosslight_util<3.0.0,>=2.1.12
24
+ Requires-Dist: fosslight_source<3.0.0,>=2.1.12
25
+ Requires-Dist: fosslight_dependency<5.0.0,>=4.1.3
26
+ Requires-Dist: fosslight_binary<6.0.0,>=5.1.9
27
+ Requires-Dist: fosslight_prechecker<5.0.0,>=4.0.0
28
+ Dynamic: author
29
+ Dynamic: classifier
30
+ Dynamic: description
31
+ Dynamic: description-content-type
32
+ Dynamic: download-url
33
+ Dynamic: home-page
34
+ Dynamic: license
35
+ Dynamic: license-file
36
+ Dynamic: requires-dist
37
+ Dynamic: requires-python
38
+ Dynamic: summary
28
39
 
29
40
  <!--
30
41
  Copyright (c) 2021 LG Electronics
@@ -0,0 +1,15 @@
1
+ fosslight_scanner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ fosslight_scanner/_get_input.py,sha256=f78M57QU7Lhw1VfZJKvYXbGsUiYMViPz1---UDIbV9I,1396
3
+ fosslight_scanner/_help.py,sha256=dq_fJoTzujChKV_RlgGlg080ZodwDZcXloYv-mwV-W0,3145
4
+ fosslight_scanner/_parse_setting.py,sha256=htxNNvhizZ2ZT18Aw6ihKuBpOMAyptkbMS5Z0_Xh5mQ,2551
5
+ fosslight_scanner/_run_compare.py,sha256=zmzX-FIvWCSkwPvEA3iHfVpyg6QDGUCpw3tJuGLdPWM,10657
6
+ fosslight_scanner/cli.py,sha256=vz_oGevbejqo3tHa4z6d-Ft0xu-gP9Pg-VmXb9IhO_s,6910
7
+ fosslight_scanner/common.py,sha256=FyEoqVsIZ4pRIlHRXZES8PYaYfy3PEmUaOn02YSuuYU,8377
8
+ fosslight_scanner/fosslight_scanner.py,sha256=wOSSnJZuUCvom9rvdwOUy7B2f-CUzDdecI2hm52dyFg,21174
9
+ fosslight_scanner/resources/bom_compare.html,sha256=VocJ9bDmQQOwfGyvXatPZ4W-QddO-IlsAvKdO0nZ7pA,2240
10
+ fosslight_scanner-2.1.10.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
11
+ fosslight_scanner-2.1.10.dist-info/METADATA,sha256=1YXdus_RPXOrScGAT1b6e9rOYzxdaP2gq9dZzX0_HuQ,8059
12
+ fosslight_scanner-2.1.10.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
13
+ fosslight_scanner-2.1.10.dist-info/entry_points.txt,sha256=dl7AA0_Jqnq0NHuCEaxcJFgstLw3sod_-FGtcgZuJbs,104
14
+ fosslight_scanner-2.1.10.dist-info/top_level.txt,sha256=43_xLb5KYpy8wOU1H2Wd2fEsWBY7Dg6ZEJJXkfT64Ak,18
15
+ fosslight_scanner-2.1.10.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.45.1)
2
+ Generator: setuptools (79.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,15 +0,0 @@
1
- fosslight_scanner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- fosslight_scanner/_get_input.py,sha256=f78M57QU7Lhw1VfZJKvYXbGsUiYMViPz1---UDIbV9I,1396
3
- fosslight_scanner/_help.py,sha256=-Dqgn1inH26614GjrIe8I5cdEziuAxTtwrUdtTkrpjQ,3084
4
- fosslight_scanner/_parse_setting.py,sha256=SoIEoPGlFXAp6__eEFEMIPYPoKLvmqxXF5X_C_uFiVI,2468
5
- fosslight_scanner/_run_compare.py,sha256=zmzX-FIvWCSkwPvEA3iHfVpyg6QDGUCpw3tJuGLdPWM,10657
6
- fosslight_scanner/cli.py,sha256=C4YNPVJJ-Ezj_6xe8k9QbIrf5V44GXbHWCGzR2FMcV8,6547
7
- fosslight_scanner/common.py,sha256=FyEoqVsIZ4pRIlHRXZES8PYaYfy3PEmUaOn02YSuuYU,8377
8
- fosslight_scanner/fosslight_scanner.py,sha256=TLMzzXjjPFAzrdS50ruqADKF8Shkf429O2BQeinkxPM,20930
9
- fosslight_scanner/resources/bom_compare.html,sha256=VocJ9bDmQQOwfGyvXatPZ4W-QddO-IlsAvKdO0nZ7pA,2240
10
- fosslight_scanner-2.1.9.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
11
- fosslight_scanner-2.1.9.dist-info/METADATA,sha256=y1f4kwBG6-smcAnnPVzKL_fAktgLYh_XwRftcFvBMMw,7822
12
- fosslight_scanner-2.1.9.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
13
- fosslight_scanner-2.1.9.dist-info/entry_points.txt,sha256=dl7AA0_Jqnq0NHuCEaxcJFgstLw3sod_-FGtcgZuJbs,104
14
- fosslight_scanner-2.1.9.dist-info/top_level.txt,sha256=43_xLb5KYpy8wOU1H2Wd2fEsWBY7Dg6ZEJJXkfT64Ak,18
15
- fosslight_scanner-2.1.9.dist-info/RECORD,,