scanoss 1.28.2__tar.gz → 1.29.0__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 (100) hide show
  1. {scanoss-1.28.2 → scanoss-1.29.0}/PACKAGE.md +1 -1
  2. {scanoss-1.28.2/src/scanoss.egg-info → scanoss-1.29.0}/PKG-INFO +3 -3
  3. {scanoss-1.28.2 → scanoss-1.29.0}/README.md +1 -1
  4. {scanoss-1.28.2 → scanoss-1.29.0}/pyproject.toml +2 -2
  5. {scanoss-1.28.2 → scanoss-1.29.0}/setup.cfg +1 -1
  6. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/__init__.py +1 -1
  7. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/cli.py +2 -3
  8. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/cyclonedx.py +4 -4
  9. scanoss-1.29.0/src/scanoss/data/build_date.txt +1 -0
  10. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/scanoss_settings.py +33 -3
  11. {scanoss-1.28.2 → scanoss-1.29.0/src/scanoss.egg-info}/PKG-INFO +3 -3
  12. scanoss-1.28.2/src/scanoss/data/build_date.txt +0 -1
  13. {scanoss-1.28.2 → scanoss-1.29.0}/LICENSE +0 -0
  14. {scanoss-1.28.2 → scanoss-1.29.0}/src/protoc_gen_swagger/__init__.py +0 -0
  15. {scanoss-1.28.2 → scanoss-1.29.0}/src/protoc_gen_swagger/options/__init__.py +0 -0
  16. {scanoss-1.28.2 → scanoss-1.29.0}/src/protoc_gen_swagger/options/annotations_pb2.py +0 -0
  17. {scanoss-1.28.2 → scanoss-1.29.0}/src/protoc_gen_swagger/options/annotations_pb2_grpc.py +0 -0
  18. {scanoss-1.28.2 → scanoss-1.29.0}/src/protoc_gen_swagger/options/openapiv2_pb2.py +0 -0
  19. {scanoss-1.28.2 → scanoss-1.29.0}/src/protoc_gen_swagger/options/openapiv2_pb2_grpc.py +0 -0
  20. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/__init__.py +0 -0
  21. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/common/__init__.py +0 -0
  22. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/common/v2/__init__.py +0 -0
  23. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/common/v2/scanoss_common_pb2.py +0 -0
  24. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/common/v2/scanoss_common_pb2_grpc.py +0 -0
  25. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/components/__init__.py +0 -0
  26. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/components/v2/__init__.py +0 -0
  27. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/components/v2/scanoss_components_pb2.py +0 -0
  28. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/components/v2/scanoss_components_pb2_grpc.py +0 -0
  29. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/cryptography/v2/scanoss_cryptography_pb2.py +0 -0
  30. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/cryptography/v2/scanoss_cryptography_pb2_grpc.py +0 -0
  31. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/dependencies/__init__.py +0 -0
  32. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/dependencies/v2/__init__.py +0 -0
  33. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/dependencies/v2/scanoss_dependencies_pb2.py +0 -0
  34. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/dependencies/v2/scanoss_dependencies_pb2_grpc.py +0 -0
  35. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/geoprovenance/__init__.py +0 -0
  36. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/geoprovenance/v2/__init__.py +0 -0
  37. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/geoprovenance/v2/scanoss_geoprovenance_pb2.py +0 -0
  38. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/geoprovenance/v2/scanoss_geoprovenance_pb2_grpc.py +0 -0
  39. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/scanning/__init__.py +0 -0
  40. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/scanning/v2/__init__.py +0 -0
  41. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/scanning/v2/scanoss_scanning_pb2.py +0 -0
  42. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/scanning/v2/scanoss_scanning_pb2_grpc.py +0 -0
  43. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/semgrep/__init__.py +0 -0
  44. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/semgrep/v2/__init__.py +0 -0
  45. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/semgrep/v2/scanoss_semgrep_pb2.py +0 -0
  46. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/semgrep/v2/scanoss_semgrep_pb2_grpc.py +0 -0
  47. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/vulnerabilities/__init__.py +0 -0
  48. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/vulnerabilities/v2/__init__.py +0 -0
  49. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/vulnerabilities/v2/scanoss_vulnerabilities_pb2.py +0 -0
  50. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/api/vulnerabilities/v2/scanoss_vulnerabilities_pb2_grpc.py +0 -0
  51. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/components.py +0 -0
  52. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/constants.py +0 -0
  53. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/cryptography.py +0 -0
  54. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/csvoutput.py +0 -0
  55. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/data/scanoss-settings-schema.json +0 -0
  56. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/data/spdx-exceptions.json +0 -0
  57. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/data/spdx-licenses.json +0 -0
  58. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/file_filters.py +0 -0
  59. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/filecount.py +0 -0
  60. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/inspection/__init__.py +0 -0
  61. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/inspection/component_summary.py +0 -0
  62. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/inspection/copyleft.py +0 -0
  63. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/inspection/inspect_base.py +0 -0
  64. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/inspection/license_summary.py +0 -0
  65. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/inspection/policy_check.py +0 -0
  66. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/inspection/undeclared_component.py +0 -0
  67. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/inspection/utils/license_utils.py +0 -0
  68. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/results.py +0 -0
  69. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/scancodedeps.py +0 -0
  70. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/scanner.py +0 -0
  71. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/scanners/__init__.py +0 -0
  72. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/scanners/container_scanner.py +0 -0
  73. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/scanners/folder_hasher.py +0 -0
  74. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/scanners/scanner_config.py +0 -0
  75. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/scanners/scanner_hfh.py +0 -0
  76. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/scanossapi.py +0 -0
  77. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/scanossbase.py +0 -0
  78. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/scanossgrpc.py +0 -0
  79. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/scanpostprocessor.py +0 -0
  80. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/scantype.py +0 -0
  81. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/spdxlite.py +0 -0
  82. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/threadeddependencies.py +0 -0
  83. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/threadedscanning.py +0 -0
  84. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/utils/__init__.py +0 -0
  85. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/utils/abstract_presenter.py +0 -0
  86. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/utils/crc64.py +0 -0
  87. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/utils/file.py +0 -0
  88. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/utils/simhash.py +0 -0
  89. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss/winnowing.py +0 -0
  90. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss.egg-info/SOURCES.txt +0 -0
  91. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss.egg-info/dependency_links.txt +0 -0
  92. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss.egg-info/entry_points.txt +0 -0
  93. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss.egg-info/requires.txt +0 -0
  94. {scanoss-1.28.2 → scanoss-1.29.0}/src/scanoss.egg-info/top_level.txt +0 -0
  95. {scanoss-1.28.2 → scanoss-1.29.0}/tests/test_csv_output.py +0 -0
  96. {scanoss-1.28.2 → scanoss-1.29.0}/tests/test_file_filters.py +0 -0
  97. {scanoss-1.28.2 → scanoss-1.29.0}/tests/test_policy_inspect.py +0 -0
  98. {scanoss-1.28.2 → scanoss-1.29.0}/tests/test_scan_post_processor.py +0 -0
  99. {scanoss-1.28.2 → scanoss-1.29.0}/tests/test_spdxlite.py +0 -0
  100. {scanoss-1.28.2 → scanoss-1.29.0}/tests/test_winnowing.py +0 -0
@@ -138,7 +138,7 @@ if __name__ == "__main__":
138
138
  ```
139
139
 
140
140
  ## Requirements
141
- Python 3.7 or higher.
141
+ Python 3.9 or higher.
142
142
 
143
143
  ## Source code
144
144
  The source for this package can be found [here](https://github.com/scanoss/scanoss.py).
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scanoss
3
- Version: 1.28.2
3
+ Version: 1.29.0
4
4
  Summary: Simple Python library to leverage the SCANOSS APIs
5
5
  Home-page: https://scanoss.com
6
6
  Author: SCANOSS
@@ -13,7 +13,7 @@ Classifier: License :: OSI Approved :: MIT License
13
13
  Classifier: Operating System :: OS Independent
14
14
  Classifier: Development Status :: 5 - Production/Stable
15
15
  Classifier: Programming Language :: Python :: 3
16
- Requires-Python: >=3.7
16
+ Requires-Python: >=3.9
17
17
  Description-Content-Type: text/markdown
18
18
  License-File: LICENSE
19
19
  Requires-Dist: requests
@@ -174,7 +174,7 @@ if __name__ == "__main__":
174
174
  ```
175
175
 
176
176
  ## Requirements
177
- Python 3.7 or higher.
177
+ Python 3.9 or higher.
178
178
 
179
179
  ## Source code
180
180
  The source for this package can be found [here](https://github.com/scanoss/scanoss.py).
@@ -24,7 +24,7 @@ To leverage the CLI from within a container, please look at [GHCR.md](GHCR.md).
24
24
  Before starting with development of this project, please read our [CONTRIBUTING](CONTRIBUTING.md) and [CODE OF CONDUCT](CODE_OF_CONDUCT.md).
25
25
 
26
26
  ### Requirements
27
- Python 3.7 or higher.
27
+ Python 3.9 or higher.
28
28
 
29
29
  The dependencies can be found in the [requirements.txt](requirements.txt) and [requirements-dev.txt](requirements-dev.txt) files.
30
30
 
@@ -6,8 +6,8 @@ build-backend = "setuptools.build_meta"
6
6
  # Enable pycodestyle (E), pyflakes (F), isort (I), pylint (PL)
7
7
  select = ["E", "F", "I", "PL"]
8
8
  line-length = 120
9
- # Assume Python 3.7+
10
- target-version = "py37"
9
+ # Assume Python 3.9+
10
+ target-version = "py39"
11
11
  exclude = [
12
12
  "tests/*",
13
13
  "test_*.py",
@@ -23,7 +23,7 @@ packages = find_namespace:
23
23
  package_dir =
24
24
  = src
25
25
  include_package_data = True
26
- python_requires = >=3.7
26
+ python_requires = >=3.9
27
27
  install_requires =
28
28
  requests
29
29
  crc32c>=2.2
@@ -22,4 +22,4 @@ SPDX-License-Identifier: MIT
22
22
  THE SOFTWARE.
23
23
  """
24
24
 
25
- __version__ = '1.28.2'
25
+ __version__ = '1.29.0'
@@ -1071,9 +1071,8 @@ def scan(parser, args): # noqa: PLR0912, PLR0915
1071
1071
  'blacklist'
1072
1072
  )
1073
1073
  else:
1074
- scan_settings.load_json_file(args.settings, args.scan_dir).set_file_type('new').set_scan_type(
1075
- 'identify'
1076
- )
1074
+ scan_settings.load_json_file(args.settings, args.scan_dir).set_file_type('new')
1075
+
1077
1076
  except ScanossSettingsError as e:
1078
1077
  print_stderr(f'Error: {e}')
1079
1078
  sys.exit(1)
@@ -48,10 +48,10 @@ class CycloneDx(ScanossBase):
48
48
  self.debug = debug
49
49
  self._spdx = SpdxLite(debug=debug)
50
50
 
51
- def parse(self, data: json): # noqa: PLR0912, PLR0915
51
+ def parse(self, data: dict): # noqa: PLR0912, PLR0915
52
52
  """
53
53
  Parse the given input (raw/plain) JSON string and return CycloneDX summary
54
- :param data: json - JSON object
54
+ :param data: dict - JSON object
55
55
  :return: CycloneDX dictionary, and vulnerability dictionary
56
56
  """
57
57
  if not data:
@@ -170,12 +170,12 @@ class CycloneDx(ScanossBase):
170
170
  success = self.produce_from_str(f.read(), output_file)
171
171
  return success
172
172
 
173
- def produce_from_json(self, data: json, output_file: str = None) -> tuple[bool, json]: # noqa: PLR0912
173
+ def produce_from_json(self, data: dict, output_file: str = None) -> tuple[bool, dict]: # noqa: PLR0912
174
174
  """
175
175
  Produce the CycloneDX output from the raw scan results input data
176
176
 
177
177
  Args:
178
- data (json): JSON object
178
+ data (dict): JSON object
179
179
  output_file (str, optional): Output file (optional). Defaults to None.
180
180
 
181
181
  Returns:
@@ -0,0 +1 @@
1
+ date: 20250715073533, utime: 1752564933
@@ -172,7 +172,7 @@ class ScanossSettings(ScanossBase):
172
172
 
173
173
  def _get_bom(self):
174
174
  """
175
- Get the Billing of Materials from the settings file
175
+ Get the Bill of Materials from the settings file
176
176
  Returns:
177
177
  dict: If using scanoss.json
178
178
  list: If using SBOM.json
@@ -196,6 +196,17 @@ class ScanossSettings(ScanossBase):
196
196
  return self._get_bom()
197
197
  return self._get_bom().get('include', [])
198
198
 
199
+
200
+ def get_bom_exclude(self) -> List[BomEntry]:
201
+ """
202
+ Get the list of components to exclude from the scan
203
+ Returns:
204
+ list: List of components to exclude from the scan
205
+ """
206
+ if self.settings_file_type == 'legacy':
207
+ return self._get_bom()
208
+ return self._get_bom().get('exclude', [])
209
+
199
210
  def get_bom_remove(self) -> List[BomEntry]:
200
211
  """
201
212
  Get the list of components to remove from the scan
@@ -225,8 +236,8 @@ class ScanossSettings(ScanossBase):
225
236
  if not self.data:
226
237
  return None
227
238
  return {
228
- 'scan_type': self.scan_type,
229
239
  'assets': json.dumps(self._get_sbom_assets()),
240
+ 'scan_type': self.scan_type,
230
241
  }
231
242
 
232
243
  def _get_sbom_assets(self):
@@ -235,7 +246,18 @@ class ScanossSettings(ScanossBase):
235
246
  Returns:
236
247
  List: List of SBOM assets
237
248
  """
238
- if self.scan_type == 'identify':
249
+
250
+ if self.settings_file_type == 'new':
251
+ if len(self.get_bom_include()):
252
+ self.scan_type = 'identify'
253
+ include_bom_entries = self._remove_duplicates(self.normalize_bom_entries(self.get_bom_include()))
254
+ return {"components": include_bom_entries}
255
+ elif len(self.get_bom_exclude()):
256
+ self.scan_type = 'blacklist'
257
+ exclude_bom_entries = self._remove_duplicates(self.normalize_bom_entries(self.get_bom_exclude()))
258
+ return {"components": exclude_bom_entries}
259
+
260
+ if self.settings_file_type == 'legacy' and self.scan_type == 'identify': # sbom-identify.json
239
261
  include_bom_entries = self._remove_duplicates(self.normalize_bom_entries(self.get_bom_include()))
240
262
  replace_bom_entries = self._remove_duplicates(self.normalize_bom_entries(self.get_bom_replace()))
241
263
  self.print_debug(
@@ -244,6 +266,14 @@ class ScanossSettings(ScanossBase):
244
266
  f'From Replace list: {[entry["purl"] for entry in replace_bom_entries]} \n'
245
267
  )
246
268
  return include_bom_entries + replace_bom_entries
269
+
270
+ if self.settings_file_type == 'legacy' and self.scan_type == 'blacklist': # sbom-identify.json
271
+ exclude_bom_entries = self._remove_duplicates(self.normalize_bom_entries(self.get_bom_exclude()))
272
+ self.print_debug(
273
+ f"Scan type set to 'blacklist'. Adding {len(exclude_bom_entries)} components as context to the scan. \n" # noqa: E501
274
+ f'From Exclude list: {[entry["purl"] for entry in exclude_bom_entries]} \n')
275
+ return exclude_bom_entries
276
+
247
277
  return self.normalize_bom_entries(self.get_bom_remove())
248
278
 
249
279
  @staticmethod
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scanoss
3
- Version: 1.28.2
3
+ Version: 1.29.0
4
4
  Summary: Simple Python library to leverage the SCANOSS APIs
5
5
  Home-page: https://scanoss.com
6
6
  Author: SCANOSS
@@ -13,7 +13,7 @@ Classifier: License :: OSI Approved :: MIT License
13
13
  Classifier: Operating System :: OS Independent
14
14
  Classifier: Development Status :: 5 - Production/Stable
15
15
  Classifier: Programming Language :: Python :: 3
16
- Requires-Python: >=3.7
16
+ Requires-Python: >=3.9
17
17
  Description-Content-Type: text/markdown
18
18
  License-File: LICENSE
19
19
  Requires-Dist: requests
@@ -174,7 +174,7 @@ if __name__ == "__main__":
174
174
  ```
175
175
 
176
176
  ## Requirements
177
- Python 3.7 or higher.
177
+ Python 3.9 or higher.
178
178
 
179
179
  ## Source code
180
180
  The source for this package can be found [here](https://github.com/scanoss/scanoss.py).
@@ -1 +0,0 @@
1
- date: 20250714124110, utime: 1752496870
File without changes