fosslight-source 2.1.11__tar.gz → 2.1.12__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.
Files changed (23) hide show
  1. {fosslight_source-2.1.11 → fosslight_source-2.1.12}/PKG-INFO +1 -1
  2. {fosslight_source-2.1.11 → fosslight_source-2.1.12}/requirements.txt +3 -1
  3. {fosslight_source-2.1.11 → fosslight_source-2.1.12}/setup.py +1 -1
  4. {fosslight_source-2.1.11 → fosslight_source-2.1.12}/src/fosslight_source/_parsing_scancode_file_item.py +15 -0
  5. {fosslight_source-2.1.11 → fosslight_source-2.1.12}/src/fosslight_source/_parsing_scanoss_file.py +8 -0
  6. {fosslight_source-2.1.11 → fosslight_source-2.1.12}/src/fosslight_source/_scan_item.py +11 -0
  7. {fosslight_source-2.1.11 → fosslight_source-2.1.12}/src/fosslight_source/run_scancode.py +2 -0
  8. {fosslight_source-2.1.11 → fosslight_source-2.1.12}/src/fosslight_source.egg-info/PKG-INFO +1 -1
  9. {fosslight_source-2.1.11 → fosslight_source-2.1.12}/src/fosslight_source.egg-info/requires.txt +3 -1
  10. {fosslight_source-2.1.11 → fosslight_source-2.1.12}/LICENSE +0 -0
  11. {fosslight_source-2.1.11 → fosslight_source-2.1.12}/MANIFEST.in +0 -0
  12. {fosslight_source-2.1.11 → fosslight_source-2.1.12}/README.md +0 -0
  13. {fosslight_source-2.1.11 → fosslight_source-2.1.12}/setup.cfg +0 -0
  14. {fosslight_source-2.1.11 → fosslight_source-2.1.12}/src/fosslight_source/__init__.py +0 -0
  15. {fosslight_source-2.1.11 → fosslight_source-2.1.12}/src/fosslight_source/_help.py +0 -0
  16. {fosslight_source-2.1.11 → fosslight_source-2.1.12}/src/fosslight_source/_license_matched.py +0 -0
  17. {fosslight_source-2.1.11 → fosslight_source-2.1.12}/src/fosslight_source/cli.py +0 -0
  18. {fosslight_source-2.1.11 → fosslight_source-2.1.12}/src/fosslight_source/run_scanoss.py +0 -0
  19. {fosslight_source-2.1.11 → fosslight_source-2.1.12}/src/fosslight_source/run_spdx_extractor.py +0 -0
  20. {fosslight_source-2.1.11 → fosslight_source-2.1.12}/src/fosslight_source.egg-info/SOURCES.txt +0 -0
  21. {fosslight_source-2.1.11 → fosslight_source-2.1.12}/src/fosslight_source.egg-info/dependency_links.txt +0 -0
  22. {fosslight_source-2.1.11 → fosslight_source-2.1.12}/src/fosslight_source.egg-info/entry_points.txt +0 -0
  23. {fosslight_source-2.1.11 → fosslight_source-2.1.12}/src/fosslight_source.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fosslight_source
3
- Version: 2.1.11
3
+ Version: 2.1.12
4
4
  Summary: FOSSLight Source Scanner
5
5
  Home-page: https://github.com/fosslight/fosslight_source_scanner
6
6
  Download-URL: https://github.com/fosslight/fosslight_source_scanner
@@ -6,4 +6,6 @@ PyYAML
6
6
  wheel>=0.38.1
7
7
  intbitset
8
8
  fosslight_binary>=5.0.0
9
- scancode-toolkit
9
+ scancode-toolkit>=32.0.2
10
+ fingerprints==1.2.3
11
+ normality==2.6.1
@@ -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.11',
17
+ version='2.1.12',
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", [])
@@ -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", [])
@@ -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)"
@@ -146,3 +147,13 @@ def is_manifest_file(file_path: str) -> bool:
146
147
  pattern = r"({})$".format("|".join(_manifest_filename))
147
148
  filename = os.path.basename(file_path)
148
149
  return bool(re.match(pattern, filename, re.IGNORECASE))
150
+
151
+
152
+ def is_package_dir(dir_path: str) -> bool:
153
+ path_parts = dir_path.split(os.path.sep)
154
+ for pkg_dir in _package_directory:
155
+ if pkg_dir in path_parts:
156
+ pkg_index = path_parts.index(pkg_dir)
157
+ pkg_path = os.path.sep.join(path_parts[:pkg_index + 1])
158
+ return True, pkg_path
159
+ 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:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fosslight-source
3
- Version: 2.1.11
3
+ Version: 2.1.12
4
4
  Summary: FOSSLight Source Scanner
5
5
  Home-page: https://github.com/fosslight/fosslight_source_scanner
6
6
  Download-URL: https://github.com/fosslight/fosslight_source_scanner
@@ -6,4 +6,6 @@ PyYAML
6
6
  wheel>=0.38.1
7
7
  intbitset
8
8
  fosslight_binary>=5.0.0
9
- scancode-toolkit
9
+ scancode-toolkit>=32.0.2
10
+ fingerprints==1.2.3
11
+ normality==2.6.1