python-ort 0.9.4__py3-none-any.whl → 0.10.0__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.
ort/__init__.py CHANGED
@@ -9,8 +9,8 @@ from .utils.yaml_loader import OrtYamlLoader, ort_yaml_load
9
9
 
10
10
  __all__ = [
11
11
  "AnalyzerResult",
12
+ "OrtResult",
12
13
  "OrtYamlLoader",
13
14
  "RepositoryConfiguration",
14
- "OrtResult",
15
15
  "ort_yaml_load",
16
16
  ]
ort/models/__init__.py CHANGED
@@ -47,10 +47,10 @@ __all__ = [
47
47
  "DependencyGraphEdge",
48
48
  "DependencyGraphNode",
49
49
  "DependencyReference",
50
+ "Excludes",
50
51
  "Hash",
51
52
  "Identifier",
52
53
  "Includes",
53
- "Excludes",
54
54
  "Issue",
55
55
  "LicenseClassifications",
56
56
  "OrtResult",
@@ -59,10 +59,10 @@ __all__ = [
59
59
  "PackageCurationData",
60
60
  "PackageLinkage",
61
61
  "PackageReference",
62
- "PathExcludeReason",
63
- "PathIncludeReason",
64
62
  "PathExclude",
63
+ "PathExcludeReason",
65
64
  "PathInclude",
65
+ "PathIncludeReason",
66
66
  "Project",
67
67
  "RemoteArtifact",
68
68
  "Repository",
@@ -38,7 +38,7 @@ class ScanStorageConfiguration(BaseModel):
38
38
  @classmethod
39
39
  def validate_provenance(cls, v):
40
40
  if not isinstance(v, dict):
41
- raise ValueError("Config must be a dictionary.")
41
+ raise TypeError("Config must be a dictionary.")
42
42
  # Return the dict as-is; ScanStorageConfiguration with extra="allow"
43
43
  # will store all fields without needing to instantiate subclasses.
44
44
  return v
ort/models/identifier.py CHANGED
@@ -64,7 +64,7 @@ class Identifier(BaseModel):
64
64
  raise TypeError("Identifier must be a dict or a string in the correct format")
65
65
 
66
66
  def __str__(self) -> str:
67
- return ":".join([self.orttype, self.namespace, self.name, self.version])
67
+ return f"{self.orttype}:{self.namespace}:{self.name}:{self.version}"
68
68
 
69
69
  @model_serializer(mode="plain")
70
70
  def serialize(self) -> str:
ort/models/provenance.py CHANGED
@@ -27,24 +27,18 @@ class UnknownProvenance(Provenance):
27
27
  Provenance information about the origin of source code.
28
28
  """
29
29
 
30
- pass
31
-
32
30
 
33
31
  class KnownProvenance(Provenance):
34
32
  """
35
33
  Provenance information about the origin of source code.
36
34
  """
37
35
 
38
- pass
39
-
40
36
 
41
37
  class RemoteProvenance(KnownProvenance):
42
38
  """
43
39
  Provenance information about the origin of source code.
44
40
  """
45
41
 
46
- pass
47
-
48
42
 
49
43
  class ArtifactProvenance(RemoteProvenance):
50
44
  """
@@ -37,3 +37,9 @@ class Vulnerability(BaseModel):
37
37
  ...,
38
38
  description="A list with detailed information for this vulnerability obtained from different sources.",
39
39
  )
40
+
41
+ first_fixed_versions: set[str] = Field(
42
+ default_factory=set,
43
+ description="The first package versions that contain a fix for this [Vulnerability]. There could be multiple"
44
+ "first versions in case vulnerability fixes are back-ported to distinct release branches.",
45
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-ort
3
- Version: 0.9.4
3
+ Version: 0.10.0
4
4
  Summary: A Python Ort model serialization library
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
@@ -13,7 +13,7 @@ Classifier: Programming Language :: Python :: 3.12
13
13
  Classifier: Programming Language :: Python :: 3.13
14
14
  Classifier: Programming Language :: Python :: 3.14
15
15
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
16
- Requires-Dist: click>=8.4.1
16
+ Requires-Dist: click>=8.4.2
17
17
  Requires-Dist: license-expression>=30.4.4
18
18
  Requires-Dist: packageurl-python>=0.17.6
19
19
  Requires-Dist: pydantic>=2.13.4
@@ -1,5 +1,5 @@
1
- ort/__init__.py,sha256=lwG8GVwXZCnL4yGOKgja1Tvrt_JeOCABZw3F8ckXuuU,469
2
- ort/models/__init__.py,sha256=v6jvd2vvIvuKIo_VN2EpyDvH_77M6LWuru-rLqQCk1I,2393
1
+ ort/__init__.py,sha256=dO9diS6jtQimfoWDHYV0Wl4Mv22jwInt1RXL6rAFnBo,469
2
+ ort/models/__init__.py,sha256=gI6oB1yLk50mE3TA6BBGUhq0-mdT4iKz2gjW366tb-U,2393
3
3
  ort/models/advisor_capability.py,sha256=u1-yQI66jVWgrOacZdIEZ_zcK_A_qZ8ma0umJs01V1o,839
4
4
  ort/models/advisor_details.py,sha256=wo5h3uKD_94ukw9nUGOBKGonCd8CF8YcPkcu7XoBR_I,754
5
5
  ort/models/advisor_result.py,sha256=LgfZRPdERNDVcIW7hRqCPyudbWXJvlSTlBLWuAONrlM,1317
@@ -38,7 +38,7 @@ ort/models/config/resolutions.py,sha256=FF1l6buB648qC70vOhaJFD1urXRLFTo-Id4Fi8r-
38
38
  ort/models/config/rule_violation_reason.py,sha256=y3K2uEGYAPGS1O4UoMdfikaTWkvymBihUNsJjbmMtTY,1281
39
39
  ort/models/config/rule_violation_resolution.py,sha256=OJFkqIKWOwC86EDIcEzxFBBUUA7WKJj7AQ6pTMBCWww,1073
40
40
  ort/models/config/s3_file_storage_configuration.py,sha256=YYhDFVXM1yfJjoZYTUvYGzPRvOyFFLdCNjN7R5oNvuY,1301
41
- ort/models/config/scan_storage_configuration.py,sha256=3aqEnussYT62xp8gtoLj4xdkvQAd2RBpTXvED_mJSjw,2627
41
+ ort/models/config/scan_storage_configuration.py,sha256=5OEYK3H8l_7u8vLUvgbMu1H_7mYFkZPCtXl34q-NBtk,2626
42
42
  ort/models/config/scanner_configuration.py,sha256=BSFgjpWwxc8MpPgvx0N5q6dJ59ATH6JE8fGCPx06hbE,3747
43
43
  ort/models/config/scope_exclude.py,sha256=jcvJ6nBiSSIxERouesDVSxg8l7RNIuQHC9tdmK3mudM,765
44
44
  ort/models/config/scope_exclude_reason.py,sha256=lw2IzBMybAex3Ck4aqHSi-9gcw9RKV-Znej3qZ9-lbk,1958
@@ -59,7 +59,7 @@ ort/models/dependency_reference.py,sha256=9fuqrF38c8bBW63Cp6sTnot-h2D3sGdkEuXR8S
59
59
  ort/models/evaluator_run.py,sha256=LsJJ-GMQKqdvJNdj3wnHMJuKD7EqojJ5VQKAPTzPFzY,467
60
60
  ort/models/file_list.py,sha256=SKHqLNutldJefNIzt7jKo6_aAdF9hlUd_Z7cQxAj_H4,1627
61
61
  ort/models/hash.py,sha256=fE1pPgx98WkmGid-SK3AuTBHMZrD6No1SJEEudrbP80,1160
62
- ort/models/identifier.py,sha256=H3NvxZlHLZQDI2hQn8AphqieL5QBkfj5Y6JTxEItSNY,2637
62
+ ort/models/identifier.py,sha256=UebjaTB-v5q5UWID77eEh497DhV60dqP0gxXhHyocC0,2633
63
63
  ort/models/issue.py,sha256=nUMKRABe8tF6pZzCdaPt2tjdYFf5zRgEipy-o68Ym5M,1153
64
64
  ort/models/license_finding.py,sha256=8vlnBV0LMb8cerOpZl6YH1eYwVuViuh0VseD6Sai_q0,1897
65
65
  ort/models/license_source.py,sha256=TY0HBFvOt0r9QxElpmobLF5SmjyA1wynGNPsqBxwHdo,727
@@ -73,7 +73,7 @@ ort/models/package_curation_data.py,sha256=aGHPlx22TSvtevkw9IIsdkBWbdp3JYw8WTJTJ
73
73
  ort/models/package_linkage.py,sha256=abwoEphvfvxaM0qtRWhEgQfY3RP6a7IxjmCgvtmsWX4,1074
74
74
  ort/models/package_reference.py,sha256=SE61OtGO6LVPCP_arLEUabBAv9gySFM-NwPfPGTerlk,1561
75
75
  ort/models/project.py,sha256=PEH2Vvij2ETuw78AezjH-NAvAYjypy9ADs_Ss1falPs,3347
76
- ort/models/provenance.py,sha256=4YIKRNFUyAhF8c9iWNK4gVTyrKaqku4_8WTP76pUmUU,3031
76
+ ort/models/provenance.py,sha256=rYJWC83kGrQf6JvvqNXFVAL89Vy4BLxuWHveV6Doxi0,3001
77
77
  ort/models/provenance_resolution_result.py,sha256=NYYHtHYut8u73RhCgBOG8sAZ8S7rivSpCddbdokoO84,2157
78
78
  ort/models/remote_artifact.py,sha256=Pd7jx1lFYqHETxvDeZYLQNyqUdE6jvlpASHsz4B1bkA,503
79
79
  ort/models/repository.py,sha256=JCvVItWUmhZpSWUb8iqu-FnpVcp3xBgKz8A-xNGipwQ,1876
@@ -97,7 +97,7 @@ ort/models/vulnerabilities/__init__.py,sha256=r-Qn75Gtj7FkYwmhWFqO26CrtJjtTRrtng
97
97
  ort/models/vulnerabilities/cvss2_rating.py,sha256=VczUVzcN9658sXgo5ign8SUzatZJSkP0ahggCjBDWuQ,1150
98
98
  ort/models/vulnerabilities/cvss3_rating.py,sha256=MMgbCx5e2lvSSveZ2HqPlPd4oG9pPzk6e2Y_F8zIoys,1393
99
99
  ort/models/vulnerabilities/cvss4_rating.py,sha256=mOLU4MlRAgY4Sg40zG13l-ey5CiE60bENt_P8nSyP-M,1393
100
- ort/models/vulnerabilities/vulnerability.py,sha256=5i-8LgHKRUnO-fdeUYNIKmchCZi5ndjAqAhDHp1N_WQ,1170
100
+ ort/models/vulnerabilities/vulnerability.py,sha256=IGfSDNCrrDAB5zKOMCwX7gAQYka1p9OUJo4pX1DKEFs,1468
101
101
  ort/models/vulnerabilities/vulnerability_reference.py,sha256=9VA_KMvxHXCnL-23HzeGpcOPTW70bh3AiHjMui8CRJ0,2984
102
102
  ort/severity.py,sha256=APhIQI9Mx9Y1gWFCX6okaSCYB6yRKxuLNXHkNV9W9WI,578
103
103
  ort/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -111,9 +111,9 @@ ort/utils/spdx/spdx_license_choice.py,sha256=hop1tcSAq1ZWMd-504tAaCJ8KxzX_fp9_-r
111
111
  ort/utils/validated_enum.py,sha256=UFAGP7BGzAx1nSBWEeMXn1X1teVb6507N-lfXBf5qGM,1643
112
112
  ort/utils/yaml_loader.py,sha256=kOiuRV93_q_ZUnAqHoNohAvqL7fkUn66WrvrdbgZKHs,1290
113
113
  tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
114
- tools/ort_validate.py,sha256=fjz0laU903mieeMwqeWsNPY8aEGPQw-xDfvEauZq4NE,1758
115
- python_ort-0.9.4.dist-info/licenses/LICENSE,sha256=koFhbHMglt1BNVuMKdBBlrQcgQsWLgo4pZW6cCtyGvA,1081
116
- python_ort-0.9.4.dist-info/WHEEL,sha256=8ZlpUMJ7mlDirmlHRhDirEx_nPnARrwDjeE92mlk68E,81
117
- python_ort-0.9.4.dist-info/entry_points.txt,sha256=v2_5_A1Rs4kGKx2g-6PZQoNwx_JlDy6pfWSjMNT_BMU,58
118
- python_ort-0.9.4.dist-info/METADATA,sha256=0wxvzLvkcM-beIAcpL6O9jGWG8O3jYdNfnC3KAUU4fw,1462
119
- python_ort-0.9.4.dist-info/RECORD,,
114
+ tools/ort_validate.py,sha256=drVJo2rHO-o8UkFu0K8rRK0ZoOYvoRCP9nG2rkys4Qg,1934
115
+ python_ort-0.10.0.dist-info/licenses/LICENSE,sha256=koFhbHMglt1BNVuMKdBBlrQcgQsWLgo4pZW6cCtyGvA,1081
116
+ python_ort-0.10.0.dist-info/WHEEL,sha256=a0ta4TK7UKMB0EbDesmi2mn0Djkly7aj_7Tu2R7SseE,81
117
+ python_ort-0.10.0.dist-info/entry_points.txt,sha256=v2_5_A1Rs4kGKx2g-6PZQoNwx_JlDy6pfWSjMNT_BMU,58
118
+ python_ort-0.10.0.dist-info/METADATA,sha256=wNSNXr8jBCiFXnvW-2qq9XxbbGEmJq5XNnojLk0wojU,1463
119
+ python_ort-0.10.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: uv 0.11.21
2
+ Generator: uv 0.11.33
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
tools/ort_validate.py CHANGED
@@ -9,7 +9,7 @@ from typing import TypeVar
9
9
  import click
10
10
  from pydantic import BaseModel, ValidationError
11
11
 
12
- from ort import RepositoryConfiguration, ort_yaml_load
12
+ from ort import OrtResult, RepositoryConfiguration, ort_yaml_load
13
13
  from ort.models import LicenseClassifications
14
14
 
15
15
  logger = logging.getLogger()
@@ -25,8 +25,9 @@ def load_and_validate(model: type[ModelT], datafile: str) -> None:
25
25
  parsed = model.model_validate(data or {})
26
26
  logger.debug(parsed.model_dump_json(indent=2))
27
27
  logger.info(f"Successfully validated {datafile} as {model.__name__}.")
28
- except ValidationError:
28
+ except ValidationError as e:
29
29
  logger.error("Validation error while parsing the ORT result:")
30
+ logger.error(e)
30
31
  sys.exit(1)
31
32
  except OSError as e:
32
33
  logger.error(f"Error while opening the file {datafile}: {e}")
@@ -39,7 +40,6 @@ def main(debug: bool = False) -> None:
39
40
  logging.basicConfig(level=logging.DEBUG)
40
41
  if debug:
41
42
  logging.basicConfig(level=logging.DEBUG)
42
- pass
43
43
 
44
44
 
45
45
  @click.command()
@@ -54,8 +54,15 @@ def repository_configuration(datafile):
54
54
  load_and_validate(RepositoryConfiguration, datafile)
55
55
 
56
56
 
57
+ @click.command()
58
+ @click.argument("datafile")
59
+ def ort_result(datafile):
60
+ load_and_validate(OrtResult, datafile)
61
+
62
+
57
63
  main.add_command(repository_configuration)
58
64
  main.add_command(license_classifications)
65
+ main.add_command(ort_result)
59
66
 
60
67
  if __name__ == "__main__":
61
68
  main()