python-ort 0.6.6__tar.gz → 0.8.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.
- {python_ort-0.6.6 → python_ort-0.8.0}/PKG-INFO +28 -2
- python_ort-0.8.0/README.md +28 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/pyproject.toml +5 -6
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/__init__.py +3 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/advisor_capability.py +2 -2
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/advisor_details.py +1 -18
- python_ort-0.8.0/src/ort/models/advisor_run.py +25 -0
- python_ort-0.8.0/src/ort/models/analyzer_run.py +24 -0
- python_ort-0.6.6/src/ort/models/analyzer_run.py → python_ort-0.8.0/src/ort/models/base_run.py +3 -11
- python_ort-0.8.0/src/ort/models/config/file_archiver_configuration.py +32 -0
- python_ort-0.8.0/src/ort/models/config/file_list_storage_configuration.py +26 -0
- python_ort-0.8.0/src/ort/models/config/file_storage_configuration.py +34 -0
- python_ort-0.8.0/src/ort/models/config/http_file_storage_configuration.py +25 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/issue_resolution.py +1 -8
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/issue_resolution_reason.py +2 -2
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/license_finding_curation_reason.py +8 -8
- python_ort-0.8.0/src/ort/models/config/local_file_storage_configuration.py +22 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/path_exclude.py +1 -8
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/path_exclude_reason.py +2 -2
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/path_include.py +1 -8
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/path_include_reason.py +2 -2
- python_ort-0.8.0/src/ort/models/config/postgres_connection.py +97 -0
- python_ort-0.8.0/src/ort/models/config/provenance_storage_configuration.py +26 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/repository_configuration.py +1 -1
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/rule_violation_reason.py +2 -2
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/rule_violation_resolution.py +1 -8
- python_ort-0.8.0/src/ort/models/config/s3_file_storage_configuration.py +42 -0
- python_ort-0.8.0/src/ort/models/config/scan_storage_configuration.py +84 -0
- python_ort-0.8.0/src/ort/models/config/scanner_configuration.py +93 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/scope_exclude.py +1 -7
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/scope_exclude_reason.py +2 -2
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/snippet/snippet_choice.py +1 -17
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/snippet/snippet_choice_reason.py +2 -2
- {python_ort-0.6.6/src/ort/models/config → python_ort-0.8.0/src/ort/models/config/snippet}/snippet_choices.py +2 -2
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/vulnerability_resolution.py +1 -8
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/vulnerability_resolution_reason.py +2 -2
- python_ort-0.8.0/src/ort/models/copyright_finding.py +23 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/dependency_graph_node.py +1 -11
- python_ort-0.8.0/src/ort/models/evaluator_run.py +19 -0
- python_ort-0.8.0/src/ort/models/file_list.py +55 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/issue.py +8 -6
- python_ort-0.8.0/src/ort/models/license_finding.py +45 -0
- python_ort-0.8.0/src/ort/models/license_source.py +23 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/ort_result.py +16 -3
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/package_linkage.py +2 -2
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/provenance.py +48 -26
- python_ort-0.8.0/src/ort/models/provenance_resolution_result.py +61 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/resolutions.py +21 -20
- python_ort-0.8.0/src/ort/models/rule_violation.py +50 -0
- python_ort-0.8.0/src/ort/models/scan_result.py +47 -0
- python_ort-0.8.0/src/ort/models/scan_summary.py +52 -0
- python_ort-0.8.0/src/ort/models/scanner_details.py +27 -0
- python_ort-0.8.0/src/ort/models/scanner_run.py +52 -0
- python_ort-0.8.0/src/ort/models/severity.py +23 -0
- python_ort-0.8.0/src/ort/models/snippet.py +72 -0
- python_ort-0.8.0/src/ort/models/snippet_finding.py +39 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/source_code_origin.py +4 -4
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/text_location.py +8 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/vcstype.py +1 -1
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/severity.py +2 -2
- python_ort-0.8.0/src/ort/utils/__init__.py +15 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/utils/spdx/spdx_expression.py +2 -2
- python_ort-0.8.0/src/ort/utils/validated_enum.py +34 -0
- python_ort-0.8.0/src/ort/utils/yaml_loader.py +39 -0
- python_ort-0.6.6/README.md +0 -3
- python_ort-0.6.6/src/ort/models/advisor_run.py +0 -39
- python_ort-0.6.6/src/ort/utils/__init__.py +0 -12
- python_ort-0.6.6/src/ort/utils/convert_enum.py +0 -18
- {python_ort-0.6.6 → python_ort-0.8.0}/LICENSE +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/__init__.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/advisor_result.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/advisor_summary.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/analyzer_result.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/__init__.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/advisor_configuration.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/analyzer_configuration.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/curations.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/excludes.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/includes.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/license_choice.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/license_finding_curation.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/package_configuration.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/package_manager_configuration.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/repository_analyzer_configuration.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/resolutions.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/snippet/__init__.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/snippet/snippet_provenance.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/vcsmatcher.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/defect.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/dependency_graph.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/dependency_graph_edge.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/dependency_reference.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/hash.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/hash_algorithm.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/identifier.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/package.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/package_curation.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/package_curation_data.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/package_reference.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/project.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/remote_artifact.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/repository.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/root_dependency_index.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/scope.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/vcsinfo.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/vcsinfo_curation_data.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/vulnerabilities/__init__.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/vulnerabilities/cvss2_rating.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/vulnerabilities/cvss3_rating.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/vulnerabilities/cvss4_rating.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/vulnerabilities/vulnerability.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/vulnerabilities/vulnerability_reference.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/types/__init__.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/types/purl_type.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/utils/environment.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/utils/processed_declared_license.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/utils/spdx/__init__.py +0 -0
- {python_ort-0.6.6 → python_ort-0.8.0}/src/ort/utils/spdx/spdx_license_choice.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-ort
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.0
|
|
4
4
|
Summary: A Python Ort model serialization library
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
License-File: LICENSE
|
|
@@ -13,6 +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: license-expression>=30.4.4
|
|
16
17
|
Requires-Dist: packageurl-python>=0.17.6
|
|
17
18
|
Requires-Dist: pydantic>=2.12.5
|
|
18
19
|
Requires-Python: >=3.10
|
|
@@ -20,4 +21,29 @@ Description-Content-Type: text/markdown
|
|
|
20
21
|
|
|
21
22
|
# Python-Ort
|
|
22
23
|
|
|
23
|
-
Python-Ort is a pydantic based library to serialize OSS Review Toolkit generated reports using the default models.
|
|
24
|
+
Python-Ort is a pydantic v2 based library to serialize [OSS Review Toolkit](https://oss-review-toolkit.org/ort/) generated reports using the default models.
|
|
25
|
+
|
|
26
|
+
## Install
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install python-ort
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Simple usage example based on a report in yml format:
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
from pprint import pprint
|
|
36
|
+
from pathlib import Path
|
|
37
|
+
from pydantic import ValidationError
|
|
38
|
+
|
|
39
|
+
from ort import OrtResult, ort_yaml_load
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
try:
|
|
43
|
+
with Path("some-result.yml").open() as fd:
|
|
44
|
+
data = ort_yaml_load(fd)
|
|
45
|
+
parsed = OrtResult(**data)
|
|
46
|
+
pprint(parsed)
|
|
47
|
+
except ValidationError as e:
|
|
48
|
+
print(e)
|
|
49
|
+
```
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Python-Ort
|
|
2
|
+
|
|
3
|
+
Python-Ort is a pydantic v2 based library to serialize [OSS Review Toolkit](https://oss-review-toolkit.org/ort/) generated reports using the default models.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install python-ort
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Simple usage example based on a report in yml format:
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
from pprint import pprint
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
from pydantic import ValidationError
|
|
17
|
+
|
|
18
|
+
from ort import OrtResult, ort_yaml_load
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
try:
|
|
22
|
+
with Path("some-result.yml").open() as fd:
|
|
23
|
+
data = ort_yaml_load(fd)
|
|
24
|
+
parsed = OrtResult(**data)
|
|
25
|
+
pprint(parsed)
|
|
26
|
+
except ValidationError as e:
|
|
27
|
+
print(e)
|
|
28
|
+
```
|
|
@@ -4,13 +4,14 @@ build-backend = "uv_build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "python-ort"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.8.0"
|
|
8
8
|
description = "A Python Ort model serialization library"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
11
11
|
license-files = ["LICENSE"]
|
|
12
12
|
requires-python = ">=3.10"
|
|
13
13
|
dependencies = [
|
|
14
|
+
"license-expression>=30.4.4",
|
|
14
15
|
"packageurl-python>=0.17.6",
|
|
15
16
|
"pydantic>=2.12.5",
|
|
16
17
|
]
|
|
@@ -35,11 +36,11 @@ module-root = "src"
|
|
|
35
36
|
|
|
36
37
|
[dependency-groups]
|
|
37
38
|
dev = [
|
|
38
|
-
"datamodel-code-generator[http]>=0.
|
|
39
|
+
"datamodel-code-generator[http]>=0.55.0",
|
|
39
40
|
"pytest>=9.0.2",
|
|
40
41
|
"rich>=14.3.3",
|
|
41
|
-
"ruff>=0.15.
|
|
42
|
-
"ty>=0.0.
|
|
42
|
+
"ruff>=0.15.6",
|
|
43
|
+
"ty>=0.0.22",
|
|
43
44
|
"types-pyyaml>=6.0.12.20250915",
|
|
44
45
|
]
|
|
45
46
|
|
|
@@ -144,9 +145,7 @@ extend-select = [
|
|
|
144
145
|
"S", # bandit
|
|
145
146
|
]
|
|
146
147
|
ignore = [
|
|
147
|
-
'N802', # function name should be lowercase
|
|
148
148
|
'SIM105', # Suggest contextlib instead of try/except with pass
|
|
149
|
-
'A004', # Python shadow builtins
|
|
150
149
|
]
|
|
151
150
|
# Unlike Flake8, default to a complexity level of 10.
|
|
152
151
|
mccabe.max-complexity = 10
|
|
@@ -5,9 +5,12 @@
|
|
|
5
5
|
from .models.analyzer_result import AnalyzerResult
|
|
6
6
|
from .models.config.repository_configuration import RepositoryConfiguration
|
|
7
7
|
from .models.ort_result import OrtResult
|
|
8
|
+
from .utils.yaml_loader import OrtYamlLoader, ort_yaml_load
|
|
8
9
|
|
|
9
10
|
__all__ = [
|
|
10
11
|
"AnalyzerResult",
|
|
12
|
+
"OrtYamlLoader",
|
|
11
13
|
"RepositoryConfiguration",
|
|
12
14
|
"OrtResult",
|
|
15
|
+
"ort_yaml_load",
|
|
13
16
|
]
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
# SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
from
|
|
5
|
+
from ort.utils.validated_enum import ValidatedIntEnum
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
class AdvisorCapability(
|
|
8
|
+
class AdvisorCapability(ValidatedIntEnum):
|
|
9
9
|
"""
|
|
10
10
|
An enum class that defines the capabilities of a specific advisor implementation.
|
|
11
11
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
from pydantic import BaseModel, ConfigDict, Field
|
|
5
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
6
6
|
|
|
7
7
|
from ort.models import AdvisorCapability
|
|
8
8
|
|
|
@@ -22,20 +22,3 @@ class AdvisorDetails(BaseModel):
|
|
|
22
22
|
description="The capabilities of the used advisor. This property indicates, which kind of findings"
|
|
23
23
|
"are retrieved by the advisor."
|
|
24
24
|
)
|
|
25
|
-
|
|
26
|
-
@field_validator("capabilities", mode="before")
|
|
27
|
-
@classmethod
|
|
28
|
-
def convert_capability(cls, v):
|
|
29
|
-
def _convert(item):
|
|
30
|
-
if isinstance(item, str):
|
|
31
|
-
try:
|
|
32
|
-
return AdvisorCapability[item]
|
|
33
|
-
except KeyError:
|
|
34
|
-
raise ValueError(f"Invalid capability: {item}")
|
|
35
|
-
return item
|
|
36
|
-
|
|
37
|
-
if isinstance(v, (list, set)):
|
|
38
|
-
return {_convert(item) for item in v}
|
|
39
|
-
if isinstance(v, str):
|
|
40
|
-
return _convert(v)
|
|
41
|
-
return v
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
from pydantic import Field
|
|
6
|
+
|
|
7
|
+
from .advisor_result import AdvisorResult
|
|
8
|
+
from .base_run import BaseRun
|
|
9
|
+
from .config.advisor_configuration import AdvisorConfiguration
|
|
10
|
+
from .identifier import Identifier
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class AdvisorRun(BaseRun):
|
|
14
|
+
"""
|
|
15
|
+
Type alias for a function that allows filtering of [AdvisorResult]s.
|
|
16
|
+
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
config: AdvisorConfiguration = Field(
|
|
20
|
+
description="The [AdvisorConfiguration] used for this run.",
|
|
21
|
+
)
|
|
22
|
+
results: dict[Identifier, list[AdvisorResult]] = Field(
|
|
23
|
+
default_factory=dict,
|
|
24
|
+
description="The result of this run.",
|
|
25
|
+
)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2025 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
from pydantic import Field
|
|
6
|
+
|
|
7
|
+
from .analyzer_result import AnalyzerResult
|
|
8
|
+
from .base_run import BaseRun
|
|
9
|
+
from .config.analyzer_configuration import AnalyzerConfiguration
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class AnalyzerRun(BaseRun):
|
|
13
|
+
"""
|
|
14
|
+
The summary of a single run of the analyzer.
|
|
15
|
+
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
config: AnalyzerConfiguration = Field(
|
|
19
|
+
description="The [AnalyzerConfiguration] used for this run.",
|
|
20
|
+
)
|
|
21
|
+
result: AnalyzerResult | None = Field(
|
|
22
|
+
default=None,
|
|
23
|
+
description="The result of this run.",
|
|
24
|
+
)
|
python_ort-0.6.6/src/ort/models/analyzer_run.py → python_ort-0.8.0/src/ort/models/base_run.py
RENAMED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: 2025 Helio Chissini de Castro <heliocastro
|
|
1
|
+
# SPDX-FileCopyrightText: 2025 Helio Chissini de Castro <dev@heliocastro.info>
|
|
2
|
+
# # SPDX-FileCopyrightText: 2026 CARIAD SE
|
|
2
3
|
# SPDX-License-Identifier: MIT
|
|
3
4
|
|
|
4
5
|
from datetime import datetime
|
|
5
6
|
|
|
6
7
|
from pydantic import BaseModel, ConfigDict, Field
|
|
7
8
|
|
|
8
|
-
from ort.models import AnalyzerResult
|
|
9
|
-
from ort.models.config.analyzer_configuration import AnalyzerConfiguration
|
|
10
9
|
from ort.utils.environment import Environment
|
|
11
10
|
|
|
12
11
|
|
|
13
|
-
class
|
|
12
|
+
class BaseRun(BaseModel):
|
|
14
13
|
"""
|
|
15
14
|
The summary of a single run of the analyzer.
|
|
16
15
|
|
|
@@ -28,10 +27,3 @@ class AnalyzerRun(BaseModel):
|
|
|
28
27
|
environment: Environment = Field(
|
|
29
28
|
description="The [Environment] in which the analyzer was executed.",
|
|
30
29
|
)
|
|
31
|
-
config: AnalyzerConfiguration = Field(
|
|
32
|
-
description="The [AnalyzerConfiguration] used for this run.",
|
|
33
|
-
)
|
|
34
|
-
result: AnalyzerResult | None = Field(
|
|
35
|
-
default=None,
|
|
36
|
-
description="The result of this run.",
|
|
37
|
-
)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Helio Chissini de Castro <dev@heliocastro.info>
|
|
2
|
+
# SPDX-FileCopyrightText: 2026 CARIAD SE
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
7
|
+
|
|
8
|
+
from .file_storage_configuration import FileStorageConfiguration
|
|
9
|
+
from .scan_storage_configuration import PostgresStorageConfiguration
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class FileArchiverConfiguration(BaseModel):
|
|
13
|
+
"""
|
|
14
|
+
The configuration model for a FileArchiver.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
model_config = ConfigDict(
|
|
18
|
+
extra="forbid",
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
enabled: bool = Field(
|
|
22
|
+
default=True,
|
|
23
|
+
description="Toggle to enable or disable the file archiver functionality altogether.",
|
|
24
|
+
)
|
|
25
|
+
file_storage: FileStorageConfiguration | None = Field(
|
|
26
|
+
default=None,
|
|
27
|
+
description="Configuration of the FileStorage used for archiving the files.",
|
|
28
|
+
)
|
|
29
|
+
postgres_storage: PostgresStorageConfiguration | None = Field(
|
|
30
|
+
default=None,
|
|
31
|
+
description="Configuration of the PostgresProvenanceFileStorage used for archiving the files.",
|
|
32
|
+
)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Helio Chissini de Castro <dev@heliocastro.info>
|
|
2
|
+
# SPDX-FileCopyrightText: 2026 CARIAD SE
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
7
|
+
|
|
8
|
+
from .file_storage_configuration import FileStorageConfiguration
|
|
9
|
+
from .scan_storage_configuration import PostgresStorageConfiguration
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class FileListStorageConfiguration(BaseModel):
|
|
13
|
+
"""
|
|
14
|
+
Configuration for the storage backends used for persisting file lists.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
model_config = ConfigDict(extra="forbid")
|
|
18
|
+
|
|
19
|
+
file_storage: FileStorageConfiguration | None = Field(
|
|
20
|
+
default=None,
|
|
21
|
+
description=("Configuration of the FileStorage used for storing the file lists."),
|
|
22
|
+
)
|
|
23
|
+
postgres_storage: PostgresStorageConfiguration | None = Field(
|
|
24
|
+
default=None,
|
|
25
|
+
description="Configuration of the PostgresProvenanceFileStorage used for storing the file lists.",
|
|
26
|
+
)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Helio Chissini de Castro <dev@heliocastro.info>
|
|
2
|
+
# SPDX-FileCopyrightText: 2026 CARIAD SE
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
7
|
+
|
|
8
|
+
from .http_file_storage_configuration import HttpFileStorageConfiguration
|
|
9
|
+
from .local_file_storage_configuration import LocalFileStorageConfiguration
|
|
10
|
+
from .s3_file_storage_configuration import S3FileStorageConfiguration
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class FileStorageConfiguration(BaseModel):
|
|
14
|
+
"""
|
|
15
|
+
The configuration model for a FileStorage. Only one of the storage options
|
|
16
|
+
can be configured.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
model_config = ConfigDict(
|
|
20
|
+
extra="forbid",
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
http_file_storage: HttpFileStorageConfiguration | None = Field(
|
|
24
|
+
default=None,
|
|
25
|
+
description="The configuration of a HttpFileStorage.",
|
|
26
|
+
)
|
|
27
|
+
local_file_storage: LocalFileStorageConfiguration | None = Field(
|
|
28
|
+
default=None,
|
|
29
|
+
description="The configuration of a LocalFileStorage.",
|
|
30
|
+
)
|
|
31
|
+
s3_file_storage: S3FileStorageConfiguration | None = Field(
|
|
32
|
+
default=None,
|
|
33
|
+
description="The configuration of a S3FileStorage.",
|
|
34
|
+
)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Helio Chissini de Castro <dev@heliocastro.info>
|
|
2
|
+
# SPDX-FileCopyrightText: 2026 CARIAD SE
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class HttpFileStorageConfiguration(BaseModel):
|
|
9
|
+
"""
|
|
10
|
+
Configuration for HTTP-based file storage.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
url: str = Field(
|
|
14
|
+
description='The URL of the HTTP server, e.g. "https://example.com/storage".',
|
|
15
|
+
)
|
|
16
|
+
query: str = Field(
|
|
17
|
+
default="",
|
|
18
|
+
description='Query string appended to the URL and path. Can contain auth data, e.g. "?user=standard&pwd=123".',
|
|
19
|
+
)
|
|
20
|
+
headers: dict[str, str] = Field(
|
|
21
|
+
default_factory=dict,
|
|
22
|
+
description="Custom headers added to all HTTP requests. Values may contain credentials.",
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
model_config = ConfigDict(extra="forbid")
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
# SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
from pydantic import BaseModel, ConfigDict, Field
|
|
6
|
-
|
|
7
|
-
from ort.utils import convert_enum
|
|
5
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
8
6
|
|
|
9
7
|
from .issue_resolution_reason import IssueResolutionReason
|
|
10
8
|
|
|
@@ -32,8 +30,3 @@ class IssueResolution(BaseModel):
|
|
|
32
30
|
comment: str = Field(
|
|
33
31
|
description="A comment to further explain why the [reason] is applicable here.",
|
|
34
32
|
)
|
|
35
|
-
|
|
36
|
-
@field_validator("reason", mode="before")
|
|
37
|
-
@classmethod
|
|
38
|
-
def validate_reason(cls, value):
|
|
39
|
-
return convert_enum(IssueResolutionReason, value)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# SPDX-FileCopyrightText: 2025 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
2
|
# SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
|
-
from
|
|
4
|
+
from ort.utils.validated_enum import ValidatedIntEnum
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
class IssueResolutionReason(
|
|
7
|
+
class IssueResolutionReason(ValidatedIntEnum):
|
|
8
8
|
"""
|
|
9
9
|
Possible reasons for resolving an Issue using an IssueResolution.
|
|
10
10
|
|
{python_ort-0.6.6 → python_ort-0.8.0}/src/ort/models/config/license_finding_curation_reason.py
RENAMED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
# SPDX-License-Identifier: MIT
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
from
|
|
6
|
+
from ...utils.validated_enum import ValidatedIntEnum
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
class LicenseFindingCurationReason(
|
|
9
|
+
class LicenseFindingCurationReason(ValidatedIntEnum):
|
|
10
10
|
"""
|
|
11
11
|
A curation for a license finding. Use it to correct a license finding or to add a license that was not
|
|
12
12
|
previously detected.
|
|
@@ -20,9 +20,9 @@ class LicenseFindingCurationReason(Enum):
|
|
|
20
20
|
REFERENCE: The findings reference a file or URL, e.g. SEE LICENSE IN LICENSE or https://jquery.org/license/.
|
|
21
21
|
"""
|
|
22
22
|
|
|
23
|
-
CODE =
|
|
24
|
-
DATA_OF =
|
|
25
|
-
DOCUMENTATION_OF =
|
|
26
|
-
INCORRECT =
|
|
27
|
-
NOT_DETECTED =
|
|
28
|
-
REFERENCE =
|
|
23
|
+
CODE = 1
|
|
24
|
+
DATA_OF = 2
|
|
25
|
+
DOCUMENTATION_OF = 3
|
|
26
|
+
INCORRECT = 4
|
|
27
|
+
NOT_DETECTED = 5
|
|
28
|
+
REFERENCE = 6
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Helio Chissini de Castro <dev@heliocastro.info>
|
|
2
|
+
# SPDX-FileCopyrightText: 2026 CARIAD SE
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class LocalFileStorageConfiguration(BaseModel):
|
|
9
|
+
"""
|
|
10
|
+
A class to hold the configuration for using local files as a storage.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
model_config = ConfigDict(extra="forbid")
|
|
14
|
+
|
|
15
|
+
directory: str = Field(
|
|
16
|
+
...,
|
|
17
|
+
description="The directory to use as a storage root.",
|
|
18
|
+
)
|
|
19
|
+
compression: bool = Field(
|
|
20
|
+
default=True,
|
|
21
|
+
description="Whether to use compression for storing files or not. Defaults to true.",
|
|
22
|
+
)
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
# SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
from pydantic import BaseModel, ConfigDict, Field
|
|
6
|
-
|
|
7
|
-
from ort.utils import convert_enum
|
|
5
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
8
6
|
|
|
9
7
|
from .path_exclude_reason import PathExcludeReason
|
|
10
8
|
|
|
@@ -32,8 +30,3 @@ class PathExclude(BaseModel):
|
|
|
32
30
|
default_factory=str,
|
|
33
31
|
description="A comment to further explain why the [reason] is applicable here.",
|
|
34
32
|
)
|
|
35
|
-
|
|
36
|
-
@field_validator("reason", mode="before")
|
|
37
|
-
@classmethod
|
|
38
|
-
def validate_reason(cls, value):
|
|
39
|
-
return convert_enum(PathExcludeReason, value)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# SPDX-FileCopyrightText: 2025 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
2
|
# SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
|
-
from
|
|
4
|
+
from ort.utils.validated_enum import ValidatedIntEnum
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
class PathExcludeReason(
|
|
7
|
+
class PathExcludeReason(ValidatedIntEnum):
|
|
8
8
|
"""
|
|
9
9
|
Possible reasons for excluding a path.
|
|
10
10
|
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
# SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
from pydantic import BaseModel, ConfigDict, Field
|
|
6
|
-
|
|
7
|
-
from ort.utils import convert_enum
|
|
5
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
8
6
|
|
|
9
7
|
from .path_include_reason import PathIncludeReason
|
|
10
8
|
|
|
@@ -32,8 +30,3 @@ class PathInclude(BaseModel):
|
|
|
32
30
|
default_factory=str,
|
|
33
31
|
description="A comment to further explain why the [reason] is applicable here.",
|
|
34
32
|
)
|
|
35
|
-
|
|
36
|
-
@field_validator("reason", mode="before")
|
|
37
|
-
@classmethod
|
|
38
|
-
def validate_reason(cls, value):
|
|
39
|
-
return convert_enum(PathIncludeReason, value)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# SPDX-FileCopyrightText: 2026 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
2
|
# SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
|
-
from
|
|
4
|
+
from ort.utils.validated_enum import ValidatedIntEnum
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
class PathIncludeReason(
|
|
7
|
+
class PathIncludeReason(ValidatedIntEnum):
|
|
8
8
|
"""
|
|
9
9
|
Possible reasons for including a path.
|
|
10
10
|
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
+
# SPDX-FileCopyrightText: 2026 CARIAD SE
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class PostgresConnection(BaseModel):
|
|
10
|
+
"""
|
|
11
|
+
PostgreSQL connection configuration and HikariCP pool settings.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
model_config = ConfigDict(extra="forbid")
|
|
15
|
+
|
|
16
|
+
url: str = Field(
|
|
17
|
+
...,
|
|
18
|
+
description=("The database URL in JDBC format."),
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
provider_schema: str = Field(
|
|
22
|
+
default="public",
|
|
23
|
+
alias="schema",
|
|
24
|
+
description=("The name of the database to use."),
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
username: str = Field(
|
|
28
|
+
...,
|
|
29
|
+
description=("The username to use for authentication."),
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
password: str = Field(
|
|
33
|
+
default_factory=str,
|
|
34
|
+
description=("The password to use for authentication."),
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
sslmode: str = Field(
|
|
38
|
+
default="verify-full",
|
|
39
|
+
description='The SSL mode to use, one of "disable", "allow", "prefer", "require", '
|
|
40
|
+
'"verify-ca" or "verify-full". See: '
|
|
41
|
+
"https://jdbc.postgresql.org/documentation/ssl/#configuring-the-client",
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
sslcert: str | None = Field(
|
|
45
|
+
None,
|
|
46
|
+
description="The full path of the certificate file. See: https://jdbc.postgresql.org/documentation/head/connect.html",
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
sslkey: str | None = Field(
|
|
50
|
+
None,
|
|
51
|
+
description="The full path of the key file. See: https://jdbc.postgresql.org/documentation/head/connect.html",
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
sslrootcert: str | None = Field(
|
|
55
|
+
None,
|
|
56
|
+
description="The full path of the root certificate file. See: "
|
|
57
|
+
"https://jdbc.postgresql.org/documentation/head/connect.html",
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
connection_timeout: int | None = Field(
|
|
61
|
+
None,
|
|
62
|
+
description="Maximum milliseconds to wait for connections from the pool. See: "
|
|
63
|
+
"https://github.com/brettwooldridge/HikariCP#frequently-used",
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
idle_timeout: int | None = Field(
|
|
67
|
+
None,
|
|
68
|
+
description="Maximum milliseconds a connection may sit idle in the pool. Requires "
|
|
69
|
+
"minimum_idle < maximum_pool_size. See: "
|
|
70
|
+
"https://github.com/brettwooldridge/HikariCP#frequently-used",
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
keepalive_time: int | None = Field(
|
|
74
|
+
None,
|
|
75
|
+
description="Frequency in milliseconds that the pool will keep an idle connection "
|
|
76
|
+
"alive. Must be lower than max_lifetime. See: "
|
|
77
|
+
"https://github.com/brettwooldridge/HikariCP#frequently-used",
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
max_lifetime: int | None = Field(
|
|
81
|
+
None,
|
|
82
|
+
description=(
|
|
83
|
+
"Maximum lifetime of a connection in milliseconds. See: "
|
|
84
|
+
"https://github.com/brettwooldridge/HikariCP#frequently-used"
|
|
85
|
+
),
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
maximum_pool_size: int | None = Field(
|
|
89
|
+
None,
|
|
90
|
+
description="Maximum size of the connection pool. See: https://github.com/brettwooldridge/HikariCP#frequently-used",
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
minimum_idle: int | None = Field(
|
|
94
|
+
None,
|
|
95
|
+
description="Minimum number of idle connections that the pool tries to maintain. "
|
|
96
|
+
"See: https://github.com/brettwooldridge/HikariCP#frequently-used",
|
|
97
|
+
)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Helio Chissini de Castro <dev@heliocastro.info>
|
|
2
|
+
# SPDX-FileCopyrightText: 2026 CARIAD SE
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
7
|
+
|
|
8
|
+
from .file_storage_configuration import FileStorageConfiguration
|
|
9
|
+
from .scan_storage_configuration import PostgresStorageConfiguration
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ProvenanceStorageConfiguration(BaseModel):
|
|
13
|
+
"""
|
|
14
|
+
Configuration of the storage to use for provenance information.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
model_config = ConfigDict(extra="forbid")
|
|
18
|
+
|
|
19
|
+
file_storage: FileStorageConfiguration | None = Field(
|
|
20
|
+
default=None,
|
|
21
|
+
description="Configuration of a file storage.",
|
|
22
|
+
)
|
|
23
|
+
postgres_storage: PostgresStorageConfiguration | None = Field(
|
|
24
|
+
default=None,
|
|
25
|
+
description="Configuration of a PostgreSQL storage.",
|
|
26
|
+
)
|
|
@@ -11,7 +11,7 @@ from .license_choice import LicenseChoice
|
|
|
11
11
|
from .package_configuration import PackageConfiguration
|
|
12
12
|
from .repository_analyzer_configuration import RepositoryAnalyzerConfiguration
|
|
13
13
|
from .resolutions import Resolutions
|
|
14
|
-
from .snippet_choices import SnippetChoices
|
|
14
|
+
from .snippet.snippet_choices import SnippetChoices
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
class RepositoryConfiguration(BaseModel):
|