scanoss 1.28.0__py3-none-any.whl → 1.28.2__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.28.0'
25
+ __version__ = '1.28.2'
scanoss/cryptography.py CHANGED
@@ -53,16 +53,16 @@ class CryptographyConfig:
53
53
  raise ScanossCryptographyError('The supplied input file is not in the correct PurlRequest format.')
54
54
  purls = input_file_validation.data['purls']
55
55
  purls_with_requirement = []
56
- if self.with_range:
57
- if any('requirement' not in p for p in purls):
58
- raise ScanossCryptographyError(
59
- f'One or more PURLs in "{self.input_file}" are missing the "requirement" field.'
60
- )
56
+ if self.with_range and any('requirement' not in p for p in purls):
57
+ raise ScanossCryptographyError(
58
+ f'One or more PURLs in "{self.input_file}" are missing the "requirement" field.'
59
+ )
60
+
61
+ for purl in purls:
62
+ if 'requirement' in purl:
63
+ purls_with_requirement.append(f'{purl["purl"]}@{purl["requirement"]}')
61
64
  else:
62
- for purl in purls:
63
- purls_with_requirement.append(f'{purl["purl"]}@{purl["requirement"]}')
64
- else:
65
- purls_with_requirement = purls
65
+ purls_with_requirement.append(purl['purl'])
66
66
  self.purl = purls_with_requirement
67
67
 
68
68
 
@@ -198,13 +198,27 @@ class Cryptography:
198
198
  return {
199
199
  'purls': [
200
200
  {
201
- 'purl': p,
202
- 'requirement': self._extract_version_from_purl(p),
201
+ 'purl': self._remove_version_from_purl(purl),
202
+ 'requirement': self._extract_version_from_purl(purl),
203
203
  }
204
- for p in self.config.purl
204
+ for purl in self.config.purl
205
205
  ]
206
206
  }
207
207
 
208
+ def _remove_version_from_purl(self, purl: str) -> str:
209
+ """
210
+ Remove version from purl
211
+
212
+ Args:
213
+ purl (str): The purl string to remove the version from
214
+
215
+ Returns:
216
+ str: The purl string without the version
217
+ """
218
+ if '@' not in purl:
219
+ return purl
220
+ return purl.split('@')[0]
221
+
208
222
  def _extract_version_from_purl(self, purl: str) -> str:
209
223
  """
210
224
  Extract version from purl
scanoss/cyclonedx.py CHANGED
@@ -219,6 +219,8 @@ class CycloneDx(ScanossBase):
219
219
  lic_set = set()
220
220
  for lic in licenses: # Get a unique set of licenses
221
221
  lc_id = lic.get('id')
222
+ if not lc_id:
223
+ continue
222
224
  spdx_id = self._spdx.get_spdx_license_id(lc_id)
223
225
  lic_set.add(spdx_id if spdx_id else lc_id)
224
226
  for lc_id in lic_set: # Store licenses for later inclusion
@@ -1 +1 @@
1
- date: 20250710142446, utime: 1752157486
1
+ date: 20250714124110, utime: 1752496870
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scanoss
3
- Version: 1.28.0
3
+ Version: 1.28.2
4
4
  Summary: Simple Python library to leverage the SCANOSS APIs
5
5
  Home-page: https://scanoss.com
6
6
  Author: SCANOSS
@@ -4,13 +4,13 @@ protoc_gen_swagger/options/annotations_pb2.py,sha256=b25EDD6gssUWnFby9gxgcpLIROT
4
4
  protoc_gen_swagger/options/annotations_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
5
5
  protoc_gen_swagger/options/openapiv2_pb2.py,sha256=vYElGp8E1vGHszvWqX97zNG9GFJ7u2QcdK9ouq0XdyI,14939
6
6
  protoc_gen_swagger/options/openapiv2_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
7
- scanoss/__init__.py,sha256=Sre04UP925CNKzy9Agq2V3oSyx5Jx3X14ZW9gtmdE5A,1146
7
+ scanoss/__init__.py,sha256=MsnWLY7filG7izRwX21k3Da6qP0zBSwOjD18RP1kjH0,1146
8
8
  scanoss/cli.py,sha256=9ELIAJy06g4KyvnALzPSQ_Rh1ypALbyQGGKrjb4sCOk,72615
9
9
  scanoss/components.py,sha256=b0R9DdKuXqyQiw5nZZwjQ6NJXBr1U9gyx1RI2FP9ozA,14511
10
10
  scanoss/constants.py,sha256=On8mQ-8ardVMHSJ7WOJqeTvGXIOWPLCgUanjE7Wk-wE,351
11
- scanoss/cryptography.py,sha256=Q39MOCscP-OFvrnPXaPOMFFkc8OKnf3mC3SgZYEtCog,9407
11
+ scanoss/cryptography.py,sha256=oj5HHgJk1e31dzQfB-5sIVmQVcUJMsP5DUPyP9QpPgQ,9806
12
12
  scanoss/csvoutput.py,sha256=qNKRwcChSkgIwLm00kZiVX6iHVQUF4Apl-sMbzJ5Taw,10192
13
- scanoss/cyclonedx.py,sha256=n3SVuHxiN1Oa-CaqAOtHsLTFefvXEjgJbpsKa0AcwDY,16267
13
+ scanoss/cyclonedx.py,sha256=9T3dFhuKzn4EO4k4IQNz6f3PwW3vdjeUfsEk_a-T-DE,16334
14
14
  scanoss/file_filters.py,sha256=2DzyvSVR7We7U36UurtJj3cdQturUjDl8j3OIqmv4Pg,20638
15
15
  scanoss/filecount.py,sha256=RZjKQ6M5P_RQg0_PMD2tsRe5Z8f98ke0sxYVjPDN8iQ,6538
16
16
  scanoss/results.py,sha256=47ZXXuU2sDjYa5vhtbWTmikit9jHhA0rsYKwkvZFI5w,9252
@@ -57,7 +57,7 @@ scanoss/api/vulnerabilities/__init__.py,sha256=IFrDk_DTJgKSZmmU-nuLXuq_s8sQZlrSC
57
57
  scanoss/api/vulnerabilities/v2/__init__.py,sha256=IFrDk_DTJgKSZmmU-nuLXuq_s8sQZlrSCHhIDMJT4r0,1122
58
58
  scanoss/api/vulnerabilities/v2/scanoss_vulnerabilities_pb2.py,sha256=CFhF80av8tenGvn9AIsGEtRJPuV2dC_syA5JLZb2lDw,5464
59
59
  scanoss/api/vulnerabilities/v2/scanoss_vulnerabilities_pb2_grpc.py,sha256=HlS4k4Zmx6RIAqaO9I96jD-eyF5yU6Xx04pVm7pdqOg,6864
60
- scanoss/data/build_date.txt,sha256=iYCQ03ljoro3XW9RTUH04V18pc85cKHRTeyfyVL06BI,40
60
+ scanoss/data/build_date.txt,sha256=S4irbTUT_4_byb8c_ZxBW1rOab38OmPTFHRtS2UyKdA,40
61
61
  scanoss/data/scanoss-settings-schema.json,sha256=ClkRYAkjAN0Sk704G8BE_Ok006oQ6YnIGmX84CF8h9w,8798
62
62
  scanoss/data/spdx-exceptions.json,sha256=s7UTYxC7jqQXr11YBlIWYCNwN6lRDFTR33Y8rpN_dA4,17953
63
63
  scanoss/data/spdx-licenses.json,sha256=A6Z0q82gaTLtnopBfzeIVZjJFxkdRW1g2TuumQc-lII,228794
@@ -79,9 +79,9 @@ scanoss/utils/abstract_presenter.py,sha256=teiDTxBj5jBMCk2T8i4l1BJPf_u4zBLWrtCTF
79
79
  scanoss/utils/crc64.py,sha256=TMrwQimSdE6imhFOUL7oAG6Kxu-8qMpGWMuMg8QpSVs,3169
80
80
  scanoss/utils/file.py,sha256=62cA9a17TU9ZvfA3FY5HY4-QOajJeSrc8S6xLA_f-3M,2980
81
81
  scanoss/utils/simhash.py,sha256=6iu8DOcecPAY36SZjCOzrrLMT9oIE7-gI6QuYwUQ7B0,5793
82
- scanoss-1.28.0.dist-info/licenses/LICENSE,sha256=LLUaXoiyOroIbr5ubAyrxBOwSRLTm35ETO2FmLpy8QQ,1074
83
- scanoss-1.28.0.dist-info/METADATA,sha256=MCZLZyTbAL_542yYN9oJGDfDUlzUxaWRaGbOqE7030o,6060
84
- scanoss-1.28.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
85
- scanoss-1.28.0.dist-info/entry_points.txt,sha256=Uy28xnaDL5KQ7V77sZD5VLDXPNxYYzSr5tsqtiXVzAs,48
86
- scanoss-1.28.0.dist-info/top_level.txt,sha256=V11PrQ6Pnrc-nDF9xnisnJ8e6-i7HqSIKVNqduRWcL8,27
87
- scanoss-1.28.0.dist-info/RECORD,,
82
+ scanoss-1.28.2.dist-info/licenses/LICENSE,sha256=LLUaXoiyOroIbr5ubAyrxBOwSRLTm35ETO2FmLpy8QQ,1074
83
+ scanoss-1.28.2.dist-info/METADATA,sha256=u3YgdNRWfs6I6z9teUdhimabgeuiyOU9YHQ5P0nERIc,6060
84
+ scanoss-1.28.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
85
+ scanoss-1.28.2.dist-info/entry_points.txt,sha256=Uy28xnaDL5KQ7V77sZD5VLDXPNxYYzSr5tsqtiXVzAs,48
86
+ scanoss-1.28.2.dist-info/top_level.txt,sha256=V11PrQ6Pnrc-nDF9xnisnJ8e6-i7HqSIKVNqduRWcL8,27
87
+ scanoss-1.28.2.dist-info/RECORD,,