fosslight-source 2.1.11__tar.gz → 2.1.13__tar.gz
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_source-2.1.11 → fosslight_source-2.1.13}/PKG-INFO +1 -1
- {fosslight_source-2.1.11 → fosslight_source-2.1.13}/requirements.txt +3 -1
- {fosslight_source-2.1.11 → fosslight_source-2.1.13}/setup.py +1 -1
- {fosslight_source-2.1.11 → fosslight_source-2.1.13}/src/fosslight_source/_parsing_scancode_file_item.py +17 -2
- {fosslight_source-2.1.11 → fosslight_source-2.1.13}/src/fosslight_source/_parsing_scanoss_file.py +8 -0
- {fosslight_source-2.1.11 → fosslight_source-2.1.13}/src/fosslight_source/_scan_item.py +12 -0
- {fosslight_source-2.1.11 → fosslight_source-2.1.13}/src/fosslight_source/run_scancode.py +2 -0
- {fosslight_source-2.1.11 → fosslight_source-2.1.13}/src/fosslight_source.egg-info/PKG-INFO +1 -1
- {fosslight_source-2.1.11 → fosslight_source-2.1.13}/src/fosslight_source.egg-info/requires.txt +3 -1
- {fosslight_source-2.1.11 → fosslight_source-2.1.13}/LICENSE +0 -0
- {fosslight_source-2.1.11 → fosslight_source-2.1.13}/MANIFEST.in +0 -0
- {fosslight_source-2.1.11 → fosslight_source-2.1.13}/README.md +0 -0
- {fosslight_source-2.1.11 → fosslight_source-2.1.13}/setup.cfg +0 -0
- {fosslight_source-2.1.11 → fosslight_source-2.1.13}/src/fosslight_source/__init__.py +0 -0
- {fosslight_source-2.1.11 → fosslight_source-2.1.13}/src/fosslight_source/_help.py +0 -0
- {fosslight_source-2.1.11 → fosslight_source-2.1.13}/src/fosslight_source/_license_matched.py +0 -0
- {fosslight_source-2.1.11 → fosslight_source-2.1.13}/src/fosslight_source/cli.py +0 -0
- {fosslight_source-2.1.11 → fosslight_source-2.1.13}/src/fosslight_source/run_scanoss.py +0 -0
- {fosslight_source-2.1.11 → fosslight_source-2.1.13}/src/fosslight_source/run_spdx_extractor.py +0 -0
- {fosslight_source-2.1.11 → fosslight_source-2.1.13}/src/fosslight_source.egg-info/SOURCES.txt +0 -0
- {fosslight_source-2.1.11 → fosslight_source-2.1.13}/src/fosslight_source.egg-info/dependency_links.txt +0 -0
- {fosslight_source-2.1.11 → fosslight_source-2.1.13}/src/fosslight_source.egg-info/entry_points.txt +0 -0
- {fosslight_source-2.1.11 → fosslight_source-2.1.13}/src/fosslight_source.egg-info/top_level.txt +0 -0
|
@@ -14,7 +14,7 @@ with open('requirements.txt', 'r', 'utf-8') as f:
|
|
|
14
14
|
if __name__ == "__main__":
|
|
15
15
|
setup(
|
|
16
16
|
name='fosslight_source',
|
|
17
|
-
version='2.1.
|
|
17
|
+
version='2.1.13',
|
|
18
18
|
package_dir={"": "src"},
|
|
19
19
|
packages=find_packages(where='src'),
|
|
20
20
|
description='FOSSLight Source Scanner',
|
|
@@ -14,6 +14,7 @@ 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
16
|
from ._scan_item import is_manifest_file
|
|
17
|
+
from ._scan_item import is_package_dir
|
|
17
18
|
from typing import Tuple
|
|
18
19
|
|
|
19
20
|
logger = logging.getLogger(constant.LOGGER_NAME)
|
|
@@ -99,6 +100,13 @@ def parsing_scancode_32_earlier(scancode_file_list: list, has_error: bool = Fals
|
|
|
99
100
|
copyright_list = file.get("copyrights", [])
|
|
100
101
|
|
|
101
102
|
result_item = SourceItem(file_path)
|
|
103
|
+
is_pkg, pkg_path = is_package_dir(os.path.dirname(file_path))
|
|
104
|
+
if is_pkg:
|
|
105
|
+
result_item.source_name_or_path = pkg_path
|
|
106
|
+
if not any(x.source_name_or_path == result_item.source_name_or_path for x in scancode_file_item):
|
|
107
|
+
result_item.exclude = True
|
|
108
|
+
scancode_file_item.append(result_item)
|
|
109
|
+
continue
|
|
102
110
|
|
|
103
111
|
if has_error and "scan_errors" in file:
|
|
104
112
|
error_msg = file.get("scan_errors", [])
|
|
@@ -185,7 +193,7 @@ def parsing_scancode_32_earlier(scancode_file_list: list, has_error: bool = Fals
|
|
|
185
193
|
result_item.licenses = license_detected
|
|
186
194
|
|
|
187
195
|
if is_manifest_file(file_path):
|
|
188
|
-
result_item.
|
|
196
|
+
result_item.is_manifest_file = True
|
|
189
197
|
|
|
190
198
|
# Remove copyright info for license text file of GPL family
|
|
191
199
|
if should_remove_copyright_for_gpl_license_text(license_detected, result_item.is_license_text):
|
|
@@ -235,6 +243,13 @@ def parsing_scancode_32_later(
|
|
|
235
243
|
continue
|
|
236
244
|
|
|
237
245
|
result_item = SourceItem(file_path)
|
|
246
|
+
is_pkg, pkg_path = is_package_dir(os.path.dirname(file_path))
|
|
247
|
+
if is_pkg:
|
|
248
|
+
result_item.source_name_or_path = pkg_path
|
|
249
|
+
if not any(x.source_name_or_path == result_item.source_name_or_path for x in scancode_file_item):
|
|
250
|
+
result_item.exclude = True
|
|
251
|
+
scancode_file_item.append(result_item)
|
|
252
|
+
continue
|
|
238
253
|
|
|
239
254
|
if has_error:
|
|
240
255
|
error_msg = file.get("scan_errors", [])
|
|
@@ -293,7 +308,7 @@ def parsing_scancode_32_later(
|
|
|
293
308
|
result_item.is_license_text = file.get("percentage_of_license_text", 0) > 90 or is_notice_file(file_path)
|
|
294
309
|
|
|
295
310
|
if is_manifest_file(file_path) and len(license_detected) > 0:
|
|
296
|
-
result_item.
|
|
311
|
+
result_item.is_manifest_file = True
|
|
297
312
|
|
|
298
313
|
# Remove copyright info for license text file of GPL family
|
|
299
314
|
if should_remove_copyright_for_gpl_license_text(license_detected, result_item.is_license_text):
|
{fosslight_source-2.1.11 → fosslight_source-2.1.13}/src/fosslight_source/_parsing_scanoss_file.py
RENAMED
|
@@ -8,6 +8,7 @@ import logging
|
|
|
8
8
|
import fosslight_util.constant as constant
|
|
9
9
|
from ._scan_item import SourceItem
|
|
10
10
|
from ._scan_item import is_exclude_file
|
|
11
|
+
from ._scan_item import is_package_dir
|
|
11
12
|
from ._scan_item import replace_word
|
|
12
13
|
from typing import Tuple
|
|
13
14
|
|
|
@@ -45,6 +46,13 @@ def parsing_scanResult(scanoss_report: dict, path_to_scan: str = "", path_to_exc
|
|
|
45
46
|
if any(os.path.commonpath([abs_file_path, exclude_path]) == exclude_path for exclude_path in abs_path_to_exclude):
|
|
46
47
|
continue
|
|
47
48
|
result_item = SourceItem(file_path)
|
|
49
|
+
is_pkg, pkg_path = is_package_dir(os.path.dirname(file_path))
|
|
50
|
+
if is_pkg:
|
|
51
|
+
result_item.source_name_or_path = pkg_path
|
|
52
|
+
if not any(x.source_name_or_path == result_item.source_name_or_path for x in scanoss_file_item):
|
|
53
|
+
result_item.exclude = True
|
|
54
|
+
scanoss_file_item.append(result_item)
|
|
55
|
+
continue
|
|
48
56
|
|
|
49
57
|
if 'id' in findings[0]:
|
|
50
58
|
if "none" == findings[0]['id']:
|
|
@@ -22,6 +22,7 @@ _exclude_directory = ["test", "tests", "doc", "docs"]
|
|
|
22
22
|
_exclude_directory = [os.path.sep + dir_name +
|
|
23
23
|
os.path.sep for dir_name in _exclude_directory]
|
|
24
24
|
_exclude_directory.append("/.")
|
|
25
|
+
_package_directory = ["node_modules", "venv", "Pods", "Carthage"]
|
|
25
26
|
MAX_LICENSE_LENGTH = 200
|
|
26
27
|
MAX_LICENSE_TOTAL_LENGTH = 600
|
|
27
28
|
SUBSTRING_LICENSE_COMMENT = "Maximum character limit (License)"
|
|
@@ -33,6 +34,7 @@ class SourceItem(FileItem):
|
|
|
33
34
|
super().__init__("")
|
|
34
35
|
self.source_name_or_path = value
|
|
35
36
|
self.is_license_text = False
|
|
37
|
+
self.is_manifest_file = False
|
|
36
38
|
self.license_reference = ""
|
|
37
39
|
self.scanoss_reference = {}
|
|
38
40
|
self.matched_lines = "" # Only for SCANOSS results
|
|
@@ -146,3 +148,13 @@ def is_manifest_file(file_path: str) -> bool:
|
|
|
146
148
|
pattern = r"({})$".format("|".join(_manifest_filename))
|
|
147
149
|
filename = os.path.basename(file_path)
|
|
148
150
|
return bool(re.match(pattern, filename, re.IGNORECASE))
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def is_package_dir(dir_path: str) -> bool:
|
|
154
|
+
path_parts = dir_path.split(os.path.sep)
|
|
155
|
+
for pkg_dir in _package_directory:
|
|
156
|
+
if pkg_dir in path_parts:
|
|
157
|
+
pkg_index = path_parts.index(pkg_dir)
|
|
158
|
+
pkg_path = os.path.sep.join(path_parts[:pkg_index + 1])
|
|
159
|
+
return True, pkg_path
|
|
160
|
+
return False, ""
|
|
@@ -127,6 +127,8 @@ def run_scan(
|
|
|
127
127
|
result_list, key=lambda row: (''.join(row.licenses)))
|
|
128
128
|
|
|
129
129
|
for scan_item in result_list:
|
|
130
|
+
if os.path.isdir(scan_item.source_name_or_path):
|
|
131
|
+
continue
|
|
130
132
|
if check_binary(os.path.join(path_to_scan, scan_item.source_name_or_path)):
|
|
131
133
|
scan_item.exclude = True
|
|
132
134
|
except Exception as ex:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fosslight_source-2.1.11 → fosslight_source-2.1.13}/src/fosslight_source/_license_matched.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fosslight_source-2.1.11 → fosslight_source-2.1.13}/src/fosslight_source/run_spdx_extractor.py
RENAMED
|
File without changes
|
{fosslight_source-2.1.11 → fosslight_source-2.1.13}/src/fosslight_source.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{fosslight_source-2.1.11 → fosslight_source-2.1.13}/src/fosslight_source.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{fosslight_source-2.1.11 → fosslight_source-2.1.13}/src/fosslight_source.egg-info/top_level.txt
RENAMED
|
File without changes
|