scanoss 1.37.0__py3-none-any.whl → 1.38.0__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.
scanoss/__init__.py CHANGED
@@ -22,4 +22,4 @@ SPDX-License-Identifier: MIT
22
22
  THE SOFTWARE.
23
23
  """
24
24
 
25
- __version__ = '1.37.0'
25
+ __version__ = '1.38.0'
scanoss/cli.py CHANGED
@@ -929,10 +929,7 @@ def setup_args() -> None: # noqa: PLR0912, PLR0915
929
929
  )
930
930
 
931
931
  delta_sub = p_delta.add_subparsers(
932
- title='Delta Commands',
933
- dest='subparsercmd',
934
- description='Delta sub-commands',
935
- help='Delta sub-commands'
932
+ title='Delta Commands', dest='subparsercmd', description='Delta sub-commands', help='Delta sub-commands'
936
933
  )
937
934
 
938
935
  # Delta Sub-command: copy
@@ -1165,9 +1162,15 @@ def setup_args() -> None: # noqa: PLR0912, PLR0915
1165
1162
  p_crypto_versions_in_range,
1166
1163
  c_licenses,
1167
1164
  e_dt,
1168
- p_copy
1165
+ p_copy,
1169
1166
  ]:
1170
- p.add_argument('--debug', '-d', action='store_true', help='Enable debug messages')
1167
+ p.add_argument(
1168
+ '--debug',
1169
+ '-d',
1170
+ action='store_true',
1171
+ default=os.environ.get('SCANOSS_DEBUG', '').lower() == 'true',
1172
+ help='Enable debug messages (can also be set via environment variable SCANOSS_DEBUG)',
1173
+ )
1171
1174
  p.add_argument('--trace', '-t', action='store_true', help='Enable trace messages, including API posts')
1172
1175
  p.add_argument('--quiet', '-q', action='store_true', help='Enable quiet mode')
1173
1176
 
@@ -1186,8 +1189,21 @@ def setup_args() -> None: # noqa: PLR0912, PLR0915
1186
1189
  sys.exit(1)
1187
1190
  elif (
1188
1191
  args.subparser
1189
- in ('utils', 'ut', 'component', 'comp', 'inspect', 'insp', 'ins',
1190
- 'crypto', 'cr', 'export', 'exp', 'delta', 'dl')
1192
+ in (
1193
+ 'utils',
1194
+ 'ut',
1195
+ 'component',
1196
+ 'comp',
1197
+ 'inspect',
1198
+ 'insp',
1199
+ 'ins',
1200
+ 'crypto',
1201
+ 'cr',
1202
+ 'export',
1203
+ 'exp',
1204
+ 'delta',
1205
+ 'dl',
1206
+ )
1191
1207
  ) and not args.subparsercmd:
1192
1208
  parser.parse_args([args.subparser, '--help']) # Force utils helps to be displayed
1193
1209
  sys.exit(1)
@@ -2634,6 +2650,7 @@ def initialise_empty_file(filename: str):
2634
2650
  print_stderr(f'Error: Unable to create output file {filename}: {e}')
2635
2651
  sys.exit(1)
2636
2652
 
2653
+
2637
2654
  def delta_copy(parser, args):
2638
2655
  """
2639
2656
  Handle delta copy command.
@@ -2661,8 +2678,15 @@ def delta_copy(parser, args):
2661
2678
  initialise_empty_file(args.output)
2662
2679
  try:
2663
2680
  # Create and configure delta copy command
2664
- delta = Delta(debug=args.debug, trace=args.trace, quiet=args.quiet, filepath=args.input, folder=args.folder,
2665
- output=args.output, root_dir=args.root)
2681
+ delta = Delta(
2682
+ debug=args.debug,
2683
+ trace=args.trace,
2684
+ quiet=args.quiet,
2685
+ filepath=args.input,
2686
+ folder=args.folder,
2687
+ output=args.output,
2688
+ root_dir=args.root,
2689
+ )
2666
2690
  # Execute copy and exit with appropriate status code
2667
2691
  status, _ = delta.copy()
2668
2692
  sys.exit(status)
@@ -2672,6 +2696,7 @@ def delta_copy(parser, args):
2672
2696
  traceback.print_exc()
2673
2697
  sys.exit(1)
2674
2698
 
2699
+
2675
2700
  def main():
2676
2701
  """
2677
2702
  Run the ScanOSS CLI
scanoss/cyclonedx.py CHANGED
@@ -152,7 +152,11 @@ class CycloneDx(ScanossBase):
152
152
  fdl = []
153
153
  if licenses:
154
154
  for lic in licenses:
155
- fdl.append({'id': lic.get('name')})
155
+ name = lic.get('name')
156
+ source = lic.get('source')
157
+ if source not in ('component_declared', 'license_file', 'file_header'):
158
+ continue
159
+ fdl.append({'id': name})
156
160
  fd['licenses'] = fdl
157
161
  cdx[purl] = fd
158
162
  # self.print_stderr(f'VD: {vdx}')
@@ -295,7 +299,8 @@ class CycloneDx(ScanossBase):
295
299
  except Exception as e:
296
300
  self.print_stderr(f'ERROR: Problem parsing input JSON: {e}')
297
301
  return False
298
- return self.produce_from_json(data, output_file)
302
+ success, _ = self.produce_from_json(data, output_file)
303
+ return success
299
304
 
300
305
  def _normalize_vulnerability_id(self, vuln: dict) -> tuple[str, str]:
301
306
  """
@@ -1 +1 @@
1
- date: 20251017144212, utime: 1760712132
1
+ date: 20251024131920, utime: 1761311960
scanoss/spdxlite.py CHANGED
@@ -226,7 +226,9 @@ class SpdxLite:
226
226
  Process license information and remove duplicates.
227
227
 
228
228
  This method filters license information to include only licenses from trusted sources
229
- ('component_declared' or 'license_file') and removes any duplicate license names.
229
+ ('component_declared', 'license_file', 'file_header'). Licenses with an unspecified
230
+ source (None or '') are allowed. Non-empty, non-allowed sources are excluded. It also
231
+ removes any duplicate license names.
230
232
  The result is a simplified list of license dictionaries containing only the 'id' field.
231
233
 
232
234
  Args:
@@ -247,7 +249,7 @@ class SpdxLite:
247
249
  for license_info in licenses:
248
250
  name = license_info.get('name')
249
251
  source = license_info.get('source')
250
- if source not in ("component_declared", "license_file", "file_header"):
252
+ if source not in (None, '') and source not in ("component_declared", "license_file", "file_header"):
251
253
  continue
252
254
  if name and name not in seen_names:
253
255
  processed_licenses.append({'id': name})
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scanoss
3
- Version: 1.37.0
3
+ Version: 1.38.0
4
4
  Summary: Simple Python library to leverage the SCANOSS APIs
5
5
  Home-page: https://scanoss.com
6
6
  Author: SCANOSS
@@ -6,13 +6,13 @@ protoc_gen_swagger/options/annotations_pb2_grpc.py,sha256=KZOW9Ciio-f9iL42FuLFnS
6
6
  protoc_gen_swagger/options/openapiv2_pb2.py,sha256=w0xDs63uyrWGgzRaQZXfJpfI7Jpyvh-i9ay_uzOR-aM,16475
7
7
  protoc_gen_swagger/options/openapiv2_pb2.pyi,sha256=hYOV6uQ2yqhP89042_V3GuAsvoBBiXf5CGuYmnFnfv4,54665
8
8
  protoc_gen_swagger/options/openapiv2_pb2_grpc.py,sha256=sje9Nh3yE7CHCUWZwtjTgwsKB4GvyGz5vOrGTnRXJfc,917
9
- scanoss/__init__.py,sha256=XOnhkCmqwWWkii_xE2t16Jl3weqDcvzxje1mYGvZL1Q,1146
10
- scanoss/cli.py,sha256=AV_tmWeCH_TxhKDOY3PR1zbLbDWt1yWa8CHpp-GABsY,97436
9
+ scanoss/__init__.py,sha256=XYJ-FpfDnKK7tuc0ms8xzYcxUDkA9f2cQOSi2LvWfTA,1146
10
+ scanoss/cli.py,sha256=1d6toykJ_rNY8XInFmzwXR2m6oB70GHO7kpb-uM-sm8,97834
11
11
  scanoss/components.py,sha256=NFyt_w3aoMotr_ZaFU-ng00_89sruc0kgY7ERnJXkmM,15891
12
12
  scanoss/constants.py,sha256=GHLTaLNVxXdTXRj7ngRK4u4S653pHzM8qFy4JFLa0wQ,450
13
13
  scanoss/cryptography.py,sha256=lOoD_dW16ARQxYiYyb5R8S7gx0FqWIsnGkKfsB0nGaU,10627
14
14
  scanoss/csvoutput.py,sha256=3wdXPeIqZG84bCtXFh8fMZO3XodekeSx6RZXoOhZMFc,10551
15
- scanoss/cyclonedx.py,sha256=y5fI2E-95vv2iZeCCsXtzSdJJUK_piHC1THsbfbXEpA,18151
15
+ scanoss/cyclonedx.py,sha256=mHeX66yQCk41N3YCIzKy_fI7fLqQnetYPFRIzUKy_M4,18416
16
16
  scanoss/delta.py,sha256=slmgnD7SsUOmfSE2zb0zdRAGo-JcjPJAtxyzuCSzO3I,9455
17
17
  scanoss/file_filters.py,sha256=QcLqunaBKQIafjNZ9_Snh9quBX5_-fsTusVmxwjC1q8,18511
18
18
  scanoss/filecount.py,sha256=RZjKQ6M5P_RQg0_PMD2tsRe5Z8f98ke0sxYVjPDN8iQ,6538
@@ -25,7 +25,7 @@ scanoss/scanossbase.py,sha256=Dkpwxa8NH8XN1iRl03NM_Mkvby0JQ4qfvCiiUrJ5ul0,3163
25
25
  scanoss/scanossgrpc.py,sha256=6s5TH2i3XB4xaXylmxFu7chlVlYjCZE_DpvRkiiaoHk,41541
26
26
  scanoss/scanpostprocessor.py,sha256=-JsThlxrU70r92GHykTMERnicdd-6jmwNsE4PH0MN2o,11063
27
27
  scanoss/scantype.py,sha256=gFmyVmKQpHWogN2iCmMj032e_sZo4T92xS3_EH5B3Tc,1310
28
- scanoss/spdxlite.py,sha256=sSEugYbtzgKB_hdFLPG6Q4rJBl01fhEU1QU_nXR0qhA,29247
28
+ scanoss/spdxlite.py,sha256=4JMxmyNmvcL6fjScihk8toWfSuQ-Pj1gzaT3SIn1fXA,29425
29
29
  scanoss/threadeddependencies.py,sha256=aN8E43iKS1pWJLJP3xCle5ewlfR5DE2-ljUzI_29Xwk,9851
30
30
  scanoss/threadedscanning.py,sha256=38ryN_kZGpzmrd_hkuiY9Sb3tOG248canGCDQDmGEwI,9317
31
31
  scanoss/winnowing.py,sha256=RsR9jRTR3TzS1pEeKQ2RuYlIG8Q7RnUQFfgPLog6B-A,21679
@@ -64,7 +64,7 @@ scanoss/api/vulnerabilities/__init__.py,sha256=IFrDk_DTJgKSZmmU-nuLXuq_s8sQZlrSC
64
64
  scanoss/api/vulnerabilities/v2/__init__.py,sha256=IFrDk_DTJgKSZmmU-nuLXuq_s8sQZlrSCHhIDMJT4r0,1122
65
65
  scanoss/api/vulnerabilities/v2/scanoss_vulnerabilities_pb2.py,sha256=pmm0MSiXkdf8e4rCIIDRcsNRixR2vGvD1Xak4l-wdwI,16550
66
66
  scanoss/api/vulnerabilities/v2/scanoss_vulnerabilities_pb2_grpc.py,sha256=BNxT5kUKQ-mgtOt5QYBM1Qrg5LNDqSpWKpfEZquIlsM,19127
67
- scanoss/data/build_date.txt,sha256=n54sthXqFE_uitQWwA2OBIhvntuAusvCrN83jYV6dbY,40
67
+ scanoss/data/build_date.txt,sha256=vIDp8v5oIkuI4Pxunu5cDrnq1xF9Ajjgdjwun5NfN74,40
68
68
  scanoss/data/scanoss-settings-schema.json,sha256=ClkRYAkjAN0Sk704G8BE_Ok006oQ6YnIGmX84CF8h9w,8798
69
69
  scanoss/data/spdx-exceptions.json,sha256=s7UTYxC7jqQXr11YBlIWYCNwN6lRDFTR33Y8rpN_dA4,17953
70
70
  scanoss/data/spdx-licenses.json,sha256=A6Z0q82gaTLtnopBfzeIVZjJFxkdRW1g2TuumQc-lII,228794
@@ -90,9 +90,9 @@ scanoss/utils/abstract_presenter.py,sha256=teiDTxBj5jBMCk2T8i4l1BJPf_u4zBLWrtCTF
90
90
  scanoss/utils/crc64.py,sha256=TMrwQimSdE6imhFOUL7oAG6Kxu-8qMpGWMuMg8QpSVs,3169
91
91
  scanoss/utils/file.py,sha256=62cA9a17TU9ZvfA3FY5HY4-QOajJeSrc8S6xLA_f-3M,2980
92
92
  scanoss/utils/simhash.py,sha256=6iu8DOcecPAY36SZjCOzrrLMT9oIE7-gI6QuYwUQ7B0,5793
93
- scanoss-1.37.0.dist-info/licenses/LICENSE,sha256=LLUaXoiyOroIbr5ubAyrxBOwSRLTm35ETO2FmLpy8QQ,1074
94
- scanoss-1.37.0.dist-info/METADATA,sha256=JPgOoHE1lzvW6ejzxv0CoMMxmo-Ku4zw3qSyrg2aLrM,6181
95
- scanoss-1.37.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
96
- scanoss-1.37.0.dist-info/entry_points.txt,sha256=Uy28xnaDL5KQ7V77sZD5VLDXPNxYYzSr5tsqtiXVzAs,48
97
- scanoss-1.37.0.dist-info/top_level.txt,sha256=V11PrQ6Pnrc-nDF9xnisnJ8e6-i7HqSIKVNqduRWcL8,27
98
- scanoss-1.37.0.dist-info/RECORD,,
93
+ scanoss-1.38.0.dist-info/licenses/LICENSE,sha256=LLUaXoiyOroIbr5ubAyrxBOwSRLTm35ETO2FmLpy8QQ,1074
94
+ scanoss-1.38.0.dist-info/METADATA,sha256=nGYHuWaHvC-qnnBCwnLwVt3-jfPV1W3Riu0W_2QVraI,6181
95
+ scanoss-1.38.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
96
+ scanoss-1.38.0.dist-info/entry_points.txt,sha256=Uy28xnaDL5KQ7V77sZD5VLDXPNxYYzSr5tsqtiXVzAs,48
97
+ scanoss-1.38.0.dist-info/top_level.txt,sha256=V11PrQ6Pnrc-nDF9xnisnJ8e6-i7HqSIKVNqduRWcL8,27
98
+ scanoss-1.38.0.dist-info/RECORD,,