python-ort 0.6.2__tar.gz → 0.6.4__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.2 → python_ort-0.6.4}/PKG-INFO +2 -1
- {python_ort-0.6.2 → python_ort-0.6.4}/pyproject.toml +6 -5
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/__init__.py +3 -3
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/__init__.py +13 -1
- python_ort-0.6.4/src/ort/models/config/excludes.py +28 -0
- python_ort-0.6.4/src/ort/models/config/includes.py +22 -0
- python_ort-0.6.4/src/ort/models/config/issue_resolution.py +32 -0
- python_ort-0.6.4/src/ort/models/config/issue_resolution_reason.py +24 -0
- python_ort-0.6.4/src/ort/models/config/license_choice.py +45 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/config/path_exclude.py +10 -3
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/config/path_exclude_reason.py +13 -39
- python_ort-0.6.4/src/ort/models/config/path_include.py +39 -0
- python_ort-0.6.4/src/ort/models/config/path_include_reason.py +19 -0
- python_ort-0.6.4/src/ort/models/config/repository_configuration.py +66 -0
- python_ort-0.6.4/src/ort/models/config/resolutions.py +35 -0
- python_ort-0.6.4/src/ort/models/config/rule_violation_reason.py +33 -0
- python_ort-0.6.4/src/ort/models/config/rule_violation_resolution.py +39 -0
- python_ort-0.6.4/src/ort/models/config/scope_exclude.py +36 -0
- python_ort-0.6.4/src/ort/models/config/scope_exclude_reason.py +49 -0
- python_ort-0.6.4/src/ort/models/config/snippet/Provenance.py +18 -0
- python_ort-0.6.4/src/ort/models/config/snippet/snippet_choice.py +63 -0
- python_ort-0.6.4/src/ort/models/config/snippet/snippet_choice_reason.py +23 -0
- python_ort-0.6.4/src/ort/models/config/vulnerability_resolution.py +31 -0
- python_ort-0.6.4/src/ort/models/config/vulnerability_resolution_reason.py +49 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/issue.py +7 -1
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/project.py +3 -2
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/repository.py +1 -1
- python_ort-0.6.4/src/ort/models/text_location.py +36 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/severity.py +5 -5
- python_ort-0.6.4/src/ort/types/__init__.py +0 -0
- python_ort-0.6.4/src/ort/types/purl_type.py +29 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/utils/__init__.py +2 -0
- python_ort-0.6.4/src/ort/utils/convert_enum.py +18 -0
- python_ort-0.6.4/src/ort/utils/spdx/__init__.py +0 -0
- python_ort-0.6.4/src/ort/utils/spdx/spdx_expression.py +29 -0
- python_ort-0.6.4/src/ort/utils/spdx/spdx_license_choice.py +44 -0
- python_ort-0.6.2/src/ort/models/config/path_include_reason.py +0 -2
- python_ort-0.6.2/src/ort/models/repository_configuration.py +0 -305
- {python_ort-0.6.2 → python_ort-0.6.4}/LICENSE +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/README.md +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/advisor_capability.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/advisor_details.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/advisor_result.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/advisor_run.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/advisor_summary.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/analyzer_result.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/analyzer_run.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/config/advisor_configuration.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/config/analyzer_configuration.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/config/curations.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/config/license_finding_curation.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/config/license_finding_curation_reason.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/config/package_configuration.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/config/package_manager_configuration.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/config/repository_analyzer_configuration.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/config/vcsmatcher.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/defect.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/dependency_graph.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/dependency_graph_edge.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/dependency_graph_node.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/dependency_reference.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/hash.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/hash_algorithm.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/identifier.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/ort_result.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/package.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/package_curation.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/package_curation_data.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/package_linkage.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/package_reference.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/remote_artifact.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/resolutions.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/root_dependency_index.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/scope.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/source_code_origin.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/vcsinfo.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/vcsinfo_curation_data.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/vcstype.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/vulnerabilities/__init__.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/vulnerabilities/cvss2_rating.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/vulnerabilities/cvss3_rating.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/vulnerabilities/cvss4_rating.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/vulnerabilities/vulnerability.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/models/vulnerabilities/vulnerability_reference.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/utils/environment.py +0 -0
- {python_ort-0.6.2 → python_ort-0.6.4}/src/ort/utils/processed_declared_license.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-ort
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.4
|
|
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: packageurl-python>=0.17.6
|
|
16
17
|
Requires-Dist: pydantic>=2.12.5
|
|
17
18
|
Requires-Python: >=3.10
|
|
18
19
|
Description-Content-Type: text/markdown
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["uv_build>=0.8.12,<0.
|
|
2
|
+
requires = ["uv_build>=0.8.12,<0.11.0"]
|
|
3
3
|
build-backend = "uv_build"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "python-ort"
|
|
7
|
-
version = "0.6.
|
|
7
|
+
version = "0.6.4"
|
|
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
|
+
"packageurl-python>=0.17.6",
|
|
14
15
|
"pydantic>=2.12.5",
|
|
15
16
|
]
|
|
16
17
|
classifiers = [
|
|
@@ -36,9 +37,9 @@ module-root = "src"
|
|
|
36
37
|
dev = [
|
|
37
38
|
"datamodel-code-generator[http]>=0.54.0",
|
|
38
39
|
"pytest>=9.0.2",
|
|
39
|
-
"rich>=14.3.
|
|
40
|
-
"ruff>=0.15.
|
|
41
|
-
"ty>=0.0.
|
|
40
|
+
"rich>=14.3.3",
|
|
41
|
+
"ruff>=0.15.4",
|
|
42
|
+
"ty>=0.0.20",
|
|
42
43
|
"types-pyyaml>=6.0.12.20250915",
|
|
43
44
|
]
|
|
44
45
|
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
#
|
|
3
3
|
# SPDX-License-Identifier: MIT
|
|
4
4
|
|
|
5
|
-
from
|
|
6
|
-
from
|
|
7
|
-
from
|
|
5
|
+
from .models.analyzer_result import AnalyzerResult
|
|
6
|
+
from .models.config.repository_configuration import RepositoryConfiguration
|
|
7
|
+
from .models.ort_result import OrtResult
|
|
8
8
|
|
|
9
9
|
__all__ = [
|
|
10
10
|
"AnalyzerResult",
|
|
@@ -6,6 +6,13 @@ from .advisor_result import AdvisorResult
|
|
|
6
6
|
from .advisor_run import AdvisorRun
|
|
7
7
|
from .analyzer_result import AnalyzerResult
|
|
8
8
|
from .analyzer_run import AnalyzerRun
|
|
9
|
+
from .config.excludes import Excludes
|
|
10
|
+
from .config.includes import Includes
|
|
11
|
+
from .config.path_exclude import PathExclude
|
|
12
|
+
from .config.path_exclude_reason import PathExcludeReason
|
|
13
|
+
from .config.path_include import PathInclude
|
|
14
|
+
from .config.path_include_reason import PathIncludeReason
|
|
15
|
+
from .config.repository_configuration import RepositoryConfiguration
|
|
9
16
|
from .dependency_graph import DependencyGraph
|
|
10
17
|
from .dependency_graph_edge import DependencyGraphEdge
|
|
11
18
|
from .dependency_graph_node import DependencyGraphNode
|
|
@@ -23,7 +30,6 @@ from .package_reference import PackageReference
|
|
|
23
30
|
from .project import Project
|
|
24
31
|
from .remote_artifact import RemoteArtifact
|
|
25
32
|
from .repository import Repository
|
|
26
|
-
from .repository_configuration import RepositoryConfiguration
|
|
27
33
|
from .root_dependency_index import RootDependencyIndex
|
|
28
34
|
from .scope import Scope
|
|
29
35
|
from .source_code_origin import SourceCodeOrigin
|
|
@@ -44,6 +50,8 @@ __all__ = [
|
|
|
44
50
|
"Hash",
|
|
45
51
|
"HashAlgorithm",
|
|
46
52
|
"Identifier",
|
|
53
|
+
"Includes",
|
|
54
|
+
"Excludes",
|
|
47
55
|
"Issue",
|
|
48
56
|
"OrtResult",
|
|
49
57
|
"Package",
|
|
@@ -51,6 +59,10 @@ __all__ = [
|
|
|
51
59
|
"PackageCurationData",
|
|
52
60
|
"PackageLinkage",
|
|
53
61
|
"PackageReference",
|
|
62
|
+
"PathExcludeReason",
|
|
63
|
+
"PathIncludeReason",
|
|
64
|
+
"PathExclude",
|
|
65
|
+
"PathInclude",
|
|
54
66
|
"Project",
|
|
55
67
|
"RemoteArtifact",
|
|
56
68
|
"Repository",
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
6
|
+
|
|
7
|
+
from .path_exclude import PathExclude
|
|
8
|
+
from .scope_exclude import ScopeExclude
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Excludes(BaseModel):
|
|
12
|
+
"""
|
|
13
|
+
Defines which parts of a repository should be excluded.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
model_config = ConfigDict(
|
|
17
|
+
extra="forbid",
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
paths: list[PathExclude] = Field(
|
|
21
|
+
default_factory=list,
|
|
22
|
+
description="Path excludes.",
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
scopes: list[ScopeExclude] = Field(
|
|
26
|
+
default_factory=list,
|
|
27
|
+
description="Scopes that will be excluded from all projects.",
|
|
28
|
+
)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
6
|
+
|
|
7
|
+
from .path_include import PathInclude
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Includes(BaseModel):
|
|
11
|
+
"""
|
|
12
|
+
Defines which parts of a repository should be excluded.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
model_config = ConfigDict(
|
|
16
|
+
extra="forbid",
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
paths: list[PathInclude] = Field(
|
|
20
|
+
default_factory=list,
|
|
21
|
+
description="Path includes.",
|
|
22
|
+
)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
6
|
+
|
|
7
|
+
from .issue_resolution_reason import IssueResolutionReason
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class IssueResolution(BaseModel):
|
|
11
|
+
"""
|
|
12
|
+
Defines the resolution of an [Issue]. This can be used to silence false positives, or issues that have been
|
|
13
|
+
identified as not being relevant.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
model_config = ConfigDict(
|
|
17
|
+
extra="forbid",
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
message: str = Field(
|
|
21
|
+
description="A regular expression string to match the messages of issues to resolve. Whitespace in the message"
|
|
22
|
+
"will be [collapsed][collapseWhitespace] and it will be converted to a [Regex] using"
|
|
23
|
+
"[RegexOption.DOT_MATCHES_ALL].",
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
reason: IssueResolutionReason = Field(
|
|
27
|
+
description="The reason why the issue is resolved.",
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
comment: str = Field(
|
|
31
|
+
description="A comment to further explain why the [reason] is applicable here.",
|
|
32
|
+
)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2025 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
from enum import IntEnum
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class IssueResolutionReason(IntEnum):
|
|
8
|
+
"""
|
|
9
|
+
Possible reasons for resolving an Issue using an IssueResolution.
|
|
10
|
+
|
|
11
|
+
properties:
|
|
12
|
+
BUILD_TOOL_ISSUE:
|
|
13
|
+
The issue originates from the build tool used by the project.
|
|
14
|
+
CANT_FIX_ISSUE:
|
|
15
|
+
The issue can not be fixed.
|
|
16
|
+
For example, it requires a change to be made by a third party that is not responsive.
|
|
17
|
+
SCANNER_ISSUE:
|
|
18
|
+
The issue is due to an irrelevant scanner issue.
|
|
19
|
+
For example, a time out on a large file that is not distributed.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
BUILD_TOOL_ISSUE = 1
|
|
23
|
+
CANT_FIX_ISSUE = 2
|
|
24
|
+
SCANNER_ISSUE = 3
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
4
|
+
|
|
5
|
+
from ...utils.spdx.spdx_license_choice import SpdxLicenseChoice
|
|
6
|
+
from ..identifier import Identifier
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class PackageLicenseChoice(BaseModel):
|
|
10
|
+
"""
|
|
11
|
+
SpdxLicenseChoice]s defined for an artifact.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
model_config = ConfigDict(
|
|
15
|
+
extra="forbid",
|
|
16
|
+
)
|
|
17
|
+
package_id: Identifier = Field(
|
|
18
|
+
...,
|
|
19
|
+
description="Package ID",
|
|
20
|
+
)
|
|
21
|
+
license_choice: list[SpdxLicenseChoice] = Field(
|
|
22
|
+
default_factory=list,
|
|
23
|
+
description="List of spdx license",
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class LicenseChoice(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
[SpdxLicenseChoice]s that are applied to all packages in the repository. As the [SpdxLicenseChoice] is applied to
|
|
30
|
+
each package that offers this license as a choice, [SpdxLicenseChoice.given] can not be null. This helps only
|
|
31
|
+
applying the choice to a wanted [SpdxLicenseChoice.given] as opposed to all licenses with that choice, which
|
|
32
|
+
could lead to unwanted applied choices.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
extra="forbid",
|
|
37
|
+
)
|
|
38
|
+
repository_license_choices: list[SpdxLicenseChoice] = Field(
|
|
39
|
+
default_factory=list,
|
|
40
|
+
description="SPDX",
|
|
41
|
+
)
|
|
42
|
+
package_license_choice: list[PackageLicenseChoice] = Field(
|
|
43
|
+
default_factory=list,
|
|
44
|
+
description="Package",
|
|
45
|
+
)
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText:
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
2
|
# SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
from pydantic import BaseModel, ConfigDict, Field
|
|
5
|
+
from pydantic import BaseModel, ConfigDict, Field, field_validator
|
|
6
6
|
|
|
7
|
-
from ort.
|
|
7
|
+
from ort.utils import convert_enum
|
|
8
|
+
|
|
9
|
+
from .path_exclude_reason import PathExcludeReason
|
|
8
10
|
|
|
9
11
|
|
|
10
12
|
class PathExclude(BaseModel):
|
|
@@ -30,3 +32,8 @@ class PathExclude(BaseModel):
|
|
|
30
32
|
default_factory=str,
|
|
31
33
|
description="A comment to further explain why the [reason] is applicable here.",
|
|
32
34
|
)
|
|
35
|
+
|
|
36
|
+
@field_validator("reason", mode="before")
|
|
37
|
+
@classmethod
|
|
38
|
+
def validate_reason(cls, value):
|
|
39
|
+
return convert_enum(PathExcludeReason, value)
|
|
@@ -1,73 +1,47 @@
|
|
|
1
1
|
# SPDX-FileCopyrightText: 2025 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
2
|
# SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
|
-
from enum import
|
|
4
|
+
from enum import IntEnum
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
class PathExcludeReason(
|
|
7
|
+
class PathExcludeReason(IntEnum):
|
|
8
8
|
"""
|
|
9
9
|
Possible reasons for excluding a path.
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
Attributes:
|
|
11
12
|
BUILD_TOOL_OF
|
|
12
13
|
The path only contains tools used for building source code which are not included in
|
|
13
14
|
distributed build artifacts.
|
|
14
|
-
|
|
15
15
|
DATA_FILE_OF
|
|
16
16
|
The path only contains data files such as fonts or images which are not included in
|
|
17
17
|
distributed build artifacts.
|
|
18
|
-
|
|
19
18
|
DOCUMENTATION_OF
|
|
20
19
|
The path only contains documentation which is not included in distributed build artifacts.
|
|
21
|
-
|
|
22
20
|
EXAMPLE_OF
|
|
23
21
|
The path only contains source code examples which are not included in distributed build
|
|
24
22
|
artifacts.
|
|
25
|
-
|
|
26
23
|
OPTIONAL_COMPONENT_OF
|
|
27
24
|
The path only contains optional components for the code that is built which are not included
|
|
28
25
|
in distributed build artifacts.
|
|
29
|
-
|
|
30
26
|
OTHER
|
|
31
27
|
Any other reason which cannot be represented by any other element of PathExcludeReason.
|
|
32
|
-
|
|
33
28
|
PROVIDED_BY
|
|
34
29
|
The path only contains packages or sources for packages that have to be provided by the user
|
|
35
30
|
of distributed build artifacts.
|
|
36
|
-
|
|
37
31
|
TEST_OF
|
|
38
32
|
The path only contains files used for testing source code which are not included in
|
|
39
33
|
distributed build artifacts.
|
|
40
|
-
|
|
41
34
|
TEST_TOOL_OF
|
|
42
35
|
The path only contains tools used for testing source code which are not included in
|
|
43
36
|
distributed build artifacts.
|
|
44
37
|
"""
|
|
45
38
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
# The path only contains source code examples which are not included in distributed build artifacts.
|
|
56
|
-
EXAMPLE_OF = auto()
|
|
57
|
-
|
|
58
|
-
# The path only contains optional components for the code that is built which are not included
|
|
59
|
-
# in distributed build artifacts.
|
|
60
|
-
OPTIONAL_COMPONENT_OF = auto()
|
|
61
|
-
|
|
62
|
-
# Any other reason which cannot be represented by any other element of PathExcludeReason.
|
|
63
|
-
OTHER = auto()
|
|
64
|
-
|
|
65
|
-
# The path only contains packages or sources for packages that have to be provided by the user
|
|
66
|
-
# of distributed build artifacts.
|
|
67
|
-
PROVIDED_BY = auto()
|
|
68
|
-
|
|
69
|
-
# The path only contains files used for testing source code which are not included in distributed build artifacts.
|
|
70
|
-
TEST_OF = auto()
|
|
71
|
-
|
|
72
|
-
# The path only contains tools used for testing source code which are not included in distributed build artifacts.
|
|
73
|
-
TEST_TOOL_OF = auto()
|
|
39
|
+
BUILD_TOOL_OF = 1
|
|
40
|
+
DATA_FILE_OF = 2
|
|
41
|
+
DOCUMENTATION_OF = 3
|
|
42
|
+
EXAMPLE_OF = 4
|
|
43
|
+
OPTIONAL_COMPONENT_OF = 5
|
|
44
|
+
OTHER = 6
|
|
45
|
+
PROVIDED_BY = 7
|
|
46
|
+
TEST_OF = 8
|
|
47
|
+
TEST_TOOL_OF = 9
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, ConfigDict, Field, field_validator
|
|
6
|
+
|
|
7
|
+
from ort.utils import convert_enum
|
|
8
|
+
|
|
9
|
+
from .path_include_reason import PathIncludeReason
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class PathInclude(BaseModel):
|
|
13
|
+
"""
|
|
14
|
+
Defines paths which should be excluded. Each file or directory that is matched by the [glob][pattern] is marked as
|
|
15
|
+
excluded. If a project definition file is matched by the [pattern], the whole project is excluded. For details about
|
|
16
|
+
the glob syntax see the [FileMatcher] implementation.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
model_config = ConfigDict(
|
|
20
|
+
extra="forbid",
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
pattern: str = Field(
|
|
24
|
+
description="A glob to match the path of the project definition file, relative to the root of the repository."
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
reason: PathIncludeReason = Field(
|
|
28
|
+
description="The reason why the project is included, out of a predefined choice.",
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
comment: str = Field(
|
|
32
|
+
default_factory=str,
|
|
33
|
+
description="A comment to further explain why the [reason] is applicable here.",
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
@field_validator("reason", mode="before")
|
|
37
|
+
@classmethod
|
|
38
|
+
def validate_reason(cls, value):
|
|
39
|
+
return convert_enum(PathIncludeReason, value)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
from enum import IntEnum
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class PathIncludeReason(IntEnum):
|
|
8
|
+
"""
|
|
9
|
+
Possible reasons for including a path.
|
|
10
|
+
|
|
11
|
+
Attributes:
|
|
12
|
+
SOURCE_OF
|
|
13
|
+
The path contains source code used to build distributed build artifacts.
|
|
14
|
+
OTHER
|
|
15
|
+
A fallback reason for the [PathIncludeReason] when none of the other reasons apply.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
SOURCE_OF = 1
|
|
19
|
+
OTHER = 2
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
6
|
+
|
|
7
|
+
from .curations import Curations
|
|
8
|
+
from .excludes import Excludes
|
|
9
|
+
from .includes import Includes
|
|
10
|
+
from .license_choice import LicenseChoice
|
|
11
|
+
from .package_configuration import PackageConfiguration
|
|
12
|
+
from .repository_analyzer_configuration import RepositoryAnalyzerConfiguration
|
|
13
|
+
from .resolutions import Resolutions
|
|
14
|
+
from .snippet.snippet_choice import SnippetChoice
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class RepositoryConfiguration(BaseModel):
|
|
18
|
+
"""
|
|
19
|
+
Represents the configuration for an OSS-Review-Toolkit (ORT) repository.
|
|
20
|
+
|
|
21
|
+
This class defines various configuration options for analyzing, including, excluding,
|
|
22
|
+
resolving, and curating artifacts in a repository. It also provides settings for package
|
|
23
|
+
configurations, license choices, and snippet choices.
|
|
24
|
+
|
|
25
|
+
Usage:
|
|
26
|
+
Instantiate this class to specify repository-level configuration for ORT analysis.
|
|
27
|
+
Each field corresponds to a specific aspect of the repository's configuration.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
model_config = ConfigDict(
|
|
31
|
+
extra="forbid",
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
analyzer: RepositoryAnalyzerConfiguration | None = Field(
|
|
35
|
+
default=None,
|
|
36
|
+
description="Define Analyzer specific options",
|
|
37
|
+
)
|
|
38
|
+
includes: Includes | None = Field(
|
|
39
|
+
default=None,
|
|
40
|
+
description="Defines which parts of a repository should be included.",
|
|
41
|
+
)
|
|
42
|
+
excludes: Excludes | None = Field(
|
|
43
|
+
default=None,
|
|
44
|
+
description="Defines which parts of a repository should be excluded.",
|
|
45
|
+
)
|
|
46
|
+
resolutions: Resolutions | None = Field(
|
|
47
|
+
default=None,
|
|
48
|
+
description="Defines resolutions for issues with this repository.",
|
|
49
|
+
)
|
|
50
|
+
curations: Curations | None = Field(
|
|
51
|
+
default=None,
|
|
52
|
+
description="Defines curations for packages used as dependencies by projects in this repository,"
|
|
53
|
+
" or curations for license findings in the source code of a project in this repository.",
|
|
54
|
+
)
|
|
55
|
+
package_configurations: list[PackageConfiguration] = Field(
|
|
56
|
+
default_factory=list,
|
|
57
|
+
description="A configuration for a specific package and provenance.",
|
|
58
|
+
)
|
|
59
|
+
license_choices: LicenseChoice | None = Field(
|
|
60
|
+
None,
|
|
61
|
+
description="A configuration to select a license from a multi-licensed package.",
|
|
62
|
+
)
|
|
63
|
+
snippet_choices: list[SnippetChoice] = Field(
|
|
64
|
+
default_factory=list,
|
|
65
|
+
description="A configuration to select a snippet from a package with multiple snippet findings.",
|
|
66
|
+
)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
6
|
+
|
|
7
|
+
from .issue_resolution import IssueResolution
|
|
8
|
+
from .rule_violation_resolution import RuleViolationResolution
|
|
9
|
+
from .vulnerability_resolution import VulnerabilityResolution
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Resolutions(BaseModel):
|
|
13
|
+
"""
|
|
14
|
+
Resolutions for issues with a repository.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
model_config = ConfigDict(
|
|
18
|
+
extra="forbid",
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
issues: list[IssueResolution] = Field(
|
|
22
|
+
default_factory=list,
|
|
23
|
+
description="Resolutions for issues with the analysis or scan of the projects"
|
|
24
|
+
"in this repository and their dependencies.",
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
rule_violations: list[RuleViolationResolution] = Field(
|
|
28
|
+
default_factory=list,
|
|
29
|
+
description="Resolutions for license policy violations.",
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
vulnerabilities: list[VulnerabilityResolution] = Field(
|
|
33
|
+
default_factory=list,
|
|
34
|
+
description="Resolutions for vulnerabilities provided by the advisor.",
|
|
35
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
from enum import IntEnum
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class RuleViolationResolutionReason(IntEnum):
|
|
8
|
+
"""
|
|
9
|
+
Properties:
|
|
10
|
+
CANT_FIX_EXCEPTION:
|
|
11
|
+
The rule violation cannot be fixed and is acceptable in this case.
|
|
12
|
+
DYNAMIC_LINKAGE_EXCEPTION:
|
|
13
|
+
The rule violation is acceptable given the fact that the dependency it relates to is
|
|
14
|
+
dynamically linked.
|
|
15
|
+
EXAMPLE_OF_EXCEPTION:
|
|
16
|
+
The rule violation is due to an inclusion of example code into a file and is acceptable
|
|
17
|
+
in this case.
|
|
18
|
+
LICENSE_ACQUIRED_EXCEPTION:
|
|
19
|
+
The rule violation is acceptable because the license for the respective package has been
|
|
20
|
+
acquired.
|
|
21
|
+
NOT_MODIFIED_EXCEPTION:
|
|
22
|
+
The rule violation is acceptable given the fact that the code it relates to has not been
|
|
23
|
+
modified.
|
|
24
|
+
PATENT_GRANT_EXCEPTION:
|
|
25
|
+
The implied patent grant is acceptable in this case.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
CANT_FIX_EXCEPTION = 1
|
|
29
|
+
DYNAMIC_LINKAGE_EXCEPTION = 2
|
|
30
|
+
EXAMPLE_OF_EXCEPTION = 3
|
|
31
|
+
LICENSE_ACQUIRED_EXCEPTION = 4
|
|
32
|
+
NOT_MODIFIED_EXCEPTION = 5
|
|
33
|
+
PATENT_GRANT_EXCEPTION = 6
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, ConfigDict, Field, field_validator
|
|
6
|
+
|
|
7
|
+
from ort.utils import convert_enum
|
|
8
|
+
|
|
9
|
+
from .rule_violation_reason import RuleViolationResolutionReason
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class RuleViolationResolution(BaseModel):
|
|
13
|
+
"""
|
|
14
|
+
Defines the resolution of a [RuleViolation]. This can be used to silence rule violations that
|
|
15
|
+
have been identified as not being relevant or are acceptable / approved.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
model_config = ConfigDict(
|
|
19
|
+
extra="forbid",
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
message: str = Field(
|
|
23
|
+
description="A regular expression string to match the messages of rule violations to resolve."
|
|
24
|
+
"Whitespace in the message will be [collapsed][collapseWhitespace] and it will be converted to"
|
|
25
|
+
"a [Regex] using [RegexOption.DOT_MATCHES_ALL]."
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
reason: RuleViolationResolutionReason = Field(
|
|
29
|
+
description="The reason why the rule violation is resolved.",
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
comment: str = Field(
|
|
33
|
+
description="A comment to further explain why the [reason] is applicable here.",
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
@field_validator("reason", mode="before")
|
|
37
|
+
@classmethod
|
|
38
|
+
def validate_reason(cls, value):
|
|
39
|
+
return convert_enum(RuleViolationResolutionReason, value)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, ConfigDict, Field, field_validator
|
|
6
|
+
|
|
7
|
+
from ort.models.config.scope_exclude_reason import ScopeExcludeReason
|
|
8
|
+
from ort.utils import convert_enum
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ScopeExclude(BaseModel):
|
|
12
|
+
"""
|
|
13
|
+
Defines a scope that should be excluded.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
model_config = ConfigDict(
|
|
17
|
+
extra="forbid",
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
pattern: str = Field(
|
|
21
|
+
description="A regular expression to match the names of scopes to exclude.",
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
reason: ScopeExcludeReason = Field(
|
|
25
|
+
description="The reason for excluding the scope.",
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
comment: str = Field(
|
|
29
|
+
default_factory=str,
|
|
30
|
+
description="A comment to further explain why the [reason] is applicable here.",
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
@field_validator("reason", mode="before")
|
|
34
|
+
@classmethod
|
|
35
|
+
def validate_reason(cls, value):
|
|
36
|
+
return convert_enum(ScopeExcludeReason, value)
|