fosslight-source 2.1.8__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.
@@ -13,6 +13,7 @@ from ._scan_item import is_exclude_dir
13
13
  from ._scan_item import is_exclude_file
14
14
  from ._scan_item import replace_word
15
15
  from ._scan_item import is_notice_file
16
+ from ._scan_item import is_manifest_file
16
17
  from typing import Tuple
17
18
 
18
19
  logger = logging.getLogger(constant.LOGGER_NAME)
@@ -169,6 +170,9 @@ def parsing_scancode_32_earlier(scancode_file_list: list, has_error: bool = Fals
169
170
  set(license_expression_list))
170
171
  result_item.comment = ','.join(license_expression_list)
171
172
 
173
+ if is_manifest_file(file_path):
174
+ result_item.is_license_text = True
175
+
172
176
  if is_exclude_file(file_path, prev_dir, prev_dir_value):
173
177
  result_item.exclude = True
174
178
  scancode_file_item.append(result_item)
@@ -269,6 +273,10 @@ def parsing_scancode_32_later(
269
273
 
270
274
  result_item.exclude = is_exclude_file(file_path)
271
275
  result_item.is_license_text = file.get("percentage_of_license_text", 0) > 90 or is_notice_file(file_path)
276
+
277
+ if is_manifest_file(file_path) and len(license_detected) > 0:
278
+ result_item.is_license_text = True
279
+
272
280
  scancode_file_item.append(result_item)
273
281
  except Exception as ex:
274
282
  msg.append(f"Error Parsing item: {ex}")
@@ -60,7 +60,6 @@ def parsing_scanResult(scanoss_report: dict, path_to_scan: str = "", path_to_exc
60
60
  license_detected = []
61
61
  license_w_source = {"component_declared": [], "file_spdx_tag": [],
62
62
  "file_header": [], "license_file": [], "scancode": []}
63
- copyright_detected = []
64
63
  if 'licenses' in findings[0]:
65
64
  for license in findings[0]['licenses']:
66
65
 
@@ -78,11 +77,6 @@ def parsing_scanResult(scanoss_report: dict, path_to_scan: str = "", path_to_exc
78
77
  if len(license_detected) > 0:
79
78
  result_item.licenses = license_detected
80
79
  result_item.scanoss_reference = license_w_source
81
- if 'copyrights' in findings[0]:
82
- for copyright in findings[0]['copyrights']:
83
- copyright_detected.append(copyright['name'])
84
- if len(copyright_detected) > 0:
85
- result_item.copyright = copyright_detected
86
80
 
87
81
  if is_exclude_file(file_path):
88
82
  result_item.exclude = True
@@ -14,6 +14,7 @@ replace_word = ["-only", "-old-style", "-or-later", "licenseref-scancode-", "lic
14
14
  _notice_filename = ['licen[cs]e[s]?', 'notice[s]?', 'legal', 'copyright[s]?', 'copying*', 'patent[s]?', 'unlicen[cs]e', 'eula',
15
15
  '[a,l]?gpl[-]?[1-3]?[.,-,_]?[0-1]?', 'mit', 'bsd[-]?[0-4]?', 'bsd[-]?[0-4][-]?clause[s]?',
16
16
  'apache[-,_]?[1-2]?[.,-,_]?[0-2]?']
17
+ _manifest_filename = [r'.*\.pom$', r'package\.json$', r'setup\.py$', r'pubspec\.yaml$', r'.*\.podspec$', r'Cargo\.toml$']
17
18
  _exclude_filename = ["changelog", "config.guess", "config.sub", "changes", "ltmain.sh",
18
19
  "configure", "configure.ac", "depcomp", "compile", "missing", "makefile"]
19
20
  _exclude_extension = [".m4", ".in", ".po"]
@@ -96,7 +97,7 @@ class SourceItem(FileItem):
96
97
  return print_rows
97
98
 
98
99
  def __eq__(self, other: object) -> bool:
99
- if type(other) == str:
100
+ if isinstance(other, str):
100
101
  return self.source_name_or_path == other
101
102
  else:
102
103
  return self.source_name_or_path == other.source_name_or_path
@@ -137,6 +138,11 @@ def is_exclude_file(file_path: str, prev_dir: str = None, prev_dir_exclude_value
137
138
 
138
139
  def is_notice_file(file_path: str) -> bool:
139
140
  pattern = r"({})(?<!w)".format("|".join(_notice_filename))
140
- file_path = file_path.lower()
141
141
  filename = os.path.basename(file_path)
142
- return bool(re.match(pattern, filename))
142
+ return bool(re.match(pattern, filename, re.IGNORECASE))
143
+
144
+
145
+ def is_manifest_file(file_path: str) -> bool:
146
+ pattern = r"({})$".format("|".join(_manifest_filename))
147
+ filename = os.path.basename(file_path)
148
+ return bool(re.match(pattern, filename, re.IGNORECASE))
fosslight_source/cli.py CHANGED
@@ -43,7 +43,6 @@ RESULT_KEY = "Scan Result"
43
43
 
44
44
 
45
45
  def main() -> None:
46
- global logger
47
46
  _result_log = {}
48
47
 
49
48
  path_to_scan = os.getcwd()
@@ -1,20 +1,19 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fosslight-source
3
- Version: 2.1.8
3
+ Version: 2.1.10
4
4
  Summary: FOSSLight Source Scanner
5
5
  Home-page: https://github.com/fosslight/fosslight_source_scanner
6
+ Download-URL: https://github.com/fosslight/fosslight_source_scanner
6
7
  Author: LG Electronics
7
8
  License: Apache-2.0
8
- Download-URL: https://github.com/fosslight/fosslight_source_scanner
9
- Platform: UNKNOWN
10
9
  Classifier: License :: OSI Approved :: Apache Software License
11
10
  Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.8
13
- Classifier: Programming Language :: Python :: 3.9
14
11
  Classifier: Programming Language :: Python :: 3.10
15
12
  Classifier: Programming Language :: Python :: 3.11
16
- Requires-Python: >=3.8
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Requires-Python: >=3.10, <3.13
17
15
  Description-Content-Type: text/markdown
16
+ License-File: LICENSE
18
17
  Requires-Dist: pyparsing
19
18
  Requires-Dist: scanoss>=1.18.0
20
19
  Requires-Dist: XlsxWriter
@@ -23,10 +22,7 @@ Requires-Dist: PyYAML
23
22
  Requires-Dist: wheel>=0.38.1
24
23
  Requires-Dist: intbitset
25
24
  Requires-Dist: fosslight-binary>=5.0.0
26
- Requires-Dist: psycopg2-binary==2.9.9
27
- Requires-Dist: beautifulsoup4==4.12.*
28
- Requires-Dist: scancode-toolkit==32.2.*; sys_platform != "darwin"
29
- Requires-Dist: scancode-toolkit==32.0.*; sys_platform == "darwin"
25
+ Requires-Dist: scancode-toolkit
30
26
 
31
27
  <!--
32
28
  Copyright (c) 2021 LG Electronics
@@ -73,5 +69,3 @@ Please see the [CONTRIBUTING guide](https://fosslight.org/hub-guide-en/contribut
73
69
  FOSSLight Source Scanner is Apache-2.0, as found in the [LICENSE][l] file.
74
70
 
75
71
  [l]: https://github.com/fosslight/fosslight_source_scanner/blob/main/LICENSE
76
-
77
-
@@ -0,0 +1,16 @@
1
+ fosslight_source/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ fosslight_source/_help.py,sha256=q3eKABhBrz8hvWSvmLVszStNpL18TCYLnUuefaU4V-M,2013
3
+ fosslight_source/_license_matched.py,sha256=-3H881XQjFDafRttBsuboS3VbCPYEvPH1pwWXptknE4,2164
4
+ fosslight_source/_parsing_scancode_file_item.py,sha256=kqYIs7cLfW6rWtHMehpgVh6EvIWWrV4HU0OlArCvEGo,13762
5
+ fosslight_source/_parsing_scanoss_file.py,sha256=IgqLf9cufc9qTLtdr_t1JSs8lRsCC4utlvpogAMtryg,4214
6
+ fosslight_source/_scan_item.py,sha256=Y13SRq3PCeHvzqZonGphkt9X1LXqmdWgYnnBI1QT8n8,5997
7
+ fosslight_source/cli.py,sha256=2TuHZvDKUp8R12DM9gesTF23RT7OBw968AdzNLtVanU,16650
8
+ fosslight_source/run_scancode.py,sha256=leq-FuGwX-kBg-sNZXQ-DSKy-uTj7w2QBFeOLgyvPxc,7094
9
+ fosslight_source/run_scanoss.py,sha256=8wu3sa-YBqjfb5x2dbDJuAdw3rrExueOW23WdzqDCaU,5721
10
+ fosslight_source/run_spdx_extractor.py,sha256=Hr9sTv06cJaVITy8amwexIW2FV8_rUcFw6hKmR9ZYws,1990
11
+ fosslight_source-2.1.10.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
12
+ fosslight_source-2.1.10.dist-info/METADATA,sha256=_ciBf5_nT5YMnQc5ih5aiQwtdVzU3DmY508B1DgSuKE,3219
13
+ fosslight_source-2.1.10.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
14
+ fosslight_source-2.1.10.dist-info/entry_points.txt,sha256=G4bBRWqSrJ68g-2M-JtNDrSZsdym_M7_KohQ2qR1vG8,113
15
+ fosslight_source-2.1.10.dist-info/top_level.txt,sha256=C2vw-0OIent84Vq-UEk1gt_kK1EL8dIItzBzp3WNyA4,17
16
+ fosslight_source-2.1.10.dist-info/RECORD,,
@@ -1,4 +1,3 @@
1
1
  [console_scripts]
2
2
  fosslight_source = fosslight_source.cli:main
3
3
  run_scancode = fosslight_source.run_scancode:main
4
-
@@ -1,16 +0,0 @@
1
- fosslight_source/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- fosslight_source/_help.py,sha256=q3eKABhBrz8hvWSvmLVszStNpL18TCYLnUuefaU4V-M,2013
3
- fosslight_source/_license_matched.py,sha256=-3H881XQjFDafRttBsuboS3VbCPYEvPH1pwWXptknE4,2164
4
- fosslight_source/_parsing_scancode_file_item.py,sha256=4U8wTuuNm-2-hanTxiQr2FvHTBrf2ZwESyea_E8caHU,13466
5
- fosslight_source/_parsing_scanoss_file.py,sha256=Ss6BWTdT1Q43xTT9GBwL6XyzHT2p57ymVm04NL76Vbg,4506
6
- fosslight_source/_scan_item.py,sha256=2RdnH5ZvrD7yjGxaHAIgSLmhq0dyW1379RScqPYJtOI,5679
7
- fosslight_source/cli.py,sha256=mF5F1vCfiMLeL700r-grhFAG-rGS4_xisDCnrJFHxic,16668
8
- fosslight_source/run_scancode.py,sha256=leq-FuGwX-kBg-sNZXQ-DSKy-uTj7w2QBFeOLgyvPxc,7094
9
- fosslight_source/run_scanoss.py,sha256=8wu3sa-YBqjfb5x2dbDJuAdw3rrExueOW23WdzqDCaU,5721
10
- fosslight_source/run_spdx_extractor.py,sha256=Hr9sTv06cJaVITy8amwexIW2FV8_rUcFw6hKmR9ZYws,1990
11
- fosslight_source-2.1.8.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
12
- fosslight_source-2.1.8.dist-info/METADATA,sha256=YJaCaiPsrxgeimPYJK6aec6HhIK93zTLCV11aWnRC50,3433
13
- fosslight_source-2.1.8.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
14
- fosslight_source-2.1.8.dist-info/entry_points.txt,sha256=NzFURHC4L8uf1PmnZ2uGQcZxR7UbYCgjetb_9aPHV-w,114
15
- fosslight_source-2.1.8.dist-info/top_level.txt,sha256=C2vw-0OIent84Vq-UEk1gt_kK1EL8dIItzBzp3WNyA4,17
16
- fosslight_source-2.1.8.dist-info/RECORD,,