python-ort 0.3.1__tar.gz → 0.4.1__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.3.1 → python_ort-0.4.1}/PKG-INFO +1 -1
- {python_ort-0.3.1 → python_ort-0.4.1}/pyproject.toml +1 -1
- python_ort-0.4.1/src/ort/__init__.py +9 -0
- python_ort-0.4.1/src/ort/models/config/analyzer_configuration.py +77 -0
- {python_ort-0.3.1 → python_ort-0.4.1}/src/ort/models/config/license_finding_curation.py +17 -1
- python_ort-0.4.1/src/ort/models/config/package_configuration.py +68 -0
- python_ort-0.4.1/src/ort/models/config/package_manager_configuration.py +26 -0
- python_ort-0.4.1/src/ort/models/config/path_exclude.py +32 -0
- python_ort-0.4.1/src/ort/models/config/path_exclude_reason.py +73 -0
- python_ort-0.4.1/src/ort/models/config/path_include_reason.py +2 -0
- python_ort-0.4.1/src/ort/models/config/repository_analyzer_configuration.py +48 -0
- python_ort-0.4.1/src/ort/models/config/vcsmatcher.py +38 -0
- python_ort-0.4.1/src/ort/models/hash_algorithm.py +116 -0
- python_ort-0.4.1/src/ort/models/identifier.py +63 -0
- {python_ort-0.3.1 → python_ort-0.4.1}/src/ort/models/ort_configuration.py +4 -5
- python_ort-0.4.1/src/ort/models/package_curation_data.py +57 -0
- {python_ort-0.3.1 → python_ort-0.4.1}/src/ort/models/repository_configuration.py +5 -9
- python_ort-0.3.1/src/ort/__init__.py +0 -19
- python_ort-0.3.1/src/ort/models/analyzer_configurations.py +0 -32
- python_ort-0.3.1/src/ort/models/hash_algorithm.py +0 -37
- python_ort-0.3.1/src/ort/models/package_curation_data.py +0 -36
- python_ort-0.3.1/src/ort/models/package_managers.py +0 -55
- {python_ort-0.3.1 → python_ort-0.4.1}/LICENSE +0 -0
- {python_ort-0.3.1 → python_ort-0.4.1}/README.md +0 -0
- {python_ort-0.3.1 → python_ort-0.4.1}/src/ort/models/__init__.py +0 -0
- {python_ort-0.3.1 → python_ort-0.4.1}/src/ort/models/config/curations.py +0 -0
- {python_ort-0.3.1 → python_ort-0.4.1}/src/ort/models/config/license_finding_curation_reason.py +0 -0
- {python_ort-0.3.1 → python_ort-0.4.1}/src/ort/models/hash.py +0 -0
- {python_ort-0.3.1 → python_ort-0.4.1}/src/ort/models/package_curation.py +0 -0
- {python_ort-0.3.1 → python_ort-0.4.1}/src/ort/models/resolutions.py +0 -0
- {python_ort-0.3.1 → python_ort-0.4.1}/src/ort/models/source_code_origin.py +0 -0
- {python_ort-0.3.1 → python_ort-0.4.1}/src/ort/models/vcsinfo.py +0 -0
- {python_ort-0.3.1 → python_ort-0.4.1}/src/ort/models/vcsinfo_curation_data.py +0 -0
- {python_ort-0.3.1 → python_ort-0.4.1}/src/ort/models/vcstype.py +0 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2025 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
6
|
+
|
|
7
|
+
from ort.models.config.package_manager_configuration import PackageManagerConfiguration
|
|
8
|
+
|
|
9
|
+
_package_managers: list[str] = [
|
|
10
|
+
"Bazel",
|
|
11
|
+
"Bower",
|
|
12
|
+
"Bundler",
|
|
13
|
+
"Cargo",
|
|
14
|
+
"Carthage",
|
|
15
|
+
"CocoaPods",
|
|
16
|
+
"Composer",
|
|
17
|
+
"Conan",
|
|
18
|
+
"GoMod",
|
|
19
|
+
"GradleInspector",
|
|
20
|
+
"Maven",
|
|
21
|
+
"NPM",
|
|
22
|
+
"NuGet",
|
|
23
|
+
"PIP",
|
|
24
|
+
"Pipenv",
|
|
25
|
+
"PNPM",
|
|
26
|
+
"Poetry",
|
|
27
|
+
"Pub",
|
|
28
|
+
"SBT",
|
|
29
|
+
"SpdxDocumentFile",
|
|
30
|
+
"Stack",
|
|
31
|
+
"SwiftPM",
|
|
32
|
+
"Tycho",
|
|
33
|
+
"Unmanaged",
|
|
34
|
+
"Yarn",
|
|
35
|
+
"Yarn2",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class AnalyzerConfiguration(BaseModel):
|
|
40
|
+
"""
|
|
41
|
+
Enable the analysis of projects that use version ranges to declare their dependencies. If set to true,
|
|
42
|
+
dependencies of exactly the same project might change with another scan done at a later time if any of the
|
|
43
|
+
(transitive) dependencies are declared using version ranges and a new version of such a dependency was
|
|
44
|
+
published in the meantime. If set to false, analysis of projects that use version ranges will fail. Defaults to
|
|
45
|
+
false.
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
model_config = ConfigDict(
|
|
49
|
+
extra="forbid",
|
|
50
|
+
)
|
|
51
|
+
allow_dynamic_versions: bool = Field(
|
|
52
|
+
default=False,
|
|
53
|
+
description="Enable the analysis of projects that use version ranges to declare their dependencies."
|
|
54
|
+
"If set to true, dependencies of exactly the same project might change with another scan done at a later time"
|
|
55
|
+
"if any of the (transitive) dependencies are declared using version ranges and a new version of such a"
|
|
56
|
+
"dependency was published in the meantime. If set to false, analysis of projects that use version ranges will"
|
|
57
|
+
"fail. Defaults to false.",
|
|
58
|
+
)
|
|
59
|
+
enabled_package_managers: list[str] = Field(
|
|
60
|
+
default=_package_managers,
|
|
61
|
+
description="A list of the case-insensitive names of package managers that are enabled."
|
|
62
|
+
"Disabling a package manager in [disabledPackageManagers] overrides enabling it here.",
|
|
63
|
+
)
|
|
64
|
+
disabled_package_managers: list[str] | None = Field(
|
|
65
|
+
default=None,
|
|
66
|
+
description="A list of the case-insensitive names of package managers that are disabled."
|
|
67
|
+
"Disabling a package manager in this list overrides [enabledPackageManagers].",
|
|
68
|
+
)
|
|
69
|
+
package_managers: dict[str, PackageManagerConfiguration] | None = Field(
|
|
70
|
+
default=None,
|
|
71
|
+
description="Get a [PackageManagerConfiguration] from [packageManagers]. The difference to accessing the map"
|
|
72
|
+
"directly is that [packageManager] can be case-insensitive.",
|
|
73
|
+
)
|
|
74
|
+
skip_excluded: bool = Field(
|
|
75
|
+
default=False,
|
|
76
|
+
description="A flag to control whether excluded scopes and paths should be skipped during the analysis.",
|
|
77
|
+
)
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
# SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
from
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
from pydantic import BaseModel, ConfigDict, Field, field_validator
|
|
6
8
|
|
|
7
9
|
from ort.models.config.license_finding_curation_reason import LicenseFindingCurationReason
|
|
8
10
|
|
|
@@ -59,3 +61,17 @@ class LicenseFindingCuration(BaseModel):
|
|
|
59
61
|
default=None,
|
|
60
62
|
description="A comment explaining this [LicenseFindingCuration].",
|
|
61
63
|
)
|
|
64
|
+
|
|
65
|
+
@field_validator("start_lines", mode="before")
|
|
66
|
+
@classmethod
|
|
67
|
+
def parse_start_lines(cls, value: Any) -> list[int] | None:
|
|
68
|
+
if value is None or value == "":
|
|
69
|
+
return None
|
|
70
|
+
if isinstance(value, str):
|
|
71
|
+
# CSV style split
|
|
72
|
+
return [int(x.strip()) for x in value.split(",") if x.strip()]
|
|
73
|
+
if isinstance(value, list):
|
|
74
|
+
return [int(x) for x in value]
|
|
75
|
+
if isinstance(value, int):
|
|
76
|
+
return [value]
|
|
77
|
+
raise ValueError("start_lines must be a comma-separated string or a list of integers")
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2025 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
6
|
+
|
|
7
|
+
from ort.models.config.license_finding_curation import LicenseFindingCuration
|
|
8
|
+
from ort.models.config.path_exclude import PathExclude
|
|
9
|
+
from ort.models.config.vcsmatcher import VcsMatcher
|
|
10
|
+
from ort.models.identifier import Identifier
|
|
11
|
+
from ort.models.source_code_origin import SourceCodeOrigin
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class PackageConfiguration(BaseModel):
|
|
15
|
+
"""
|
|
16
|
+
A class used in the [OrtConfiguration] to configure [PathExclude]s and [LicenseFindingCuration]s for a specific
|
|
17
|
+
[Package]'s [Identifier] (and [Provenance]).
|
|
18
|
+
Note that [PathExclude]s and [LicenseFindingCuration]s for [Project]s are configured by a
|
|
19
|
+
[RepositoryConfiguration]'s excludes and curations properties instead.
|
|
20
|
+
|
|
21
|
+
Attributes:
|
|
22
|
+
id (Identifier): The [Identifier] which must match with the identifier of the package in
|
|
23
|
+
order for this package curation to apply. The [version][Identifier.version] can be
|
|
24
|
+
either a plain version string matched for equality, or an Ivy-style version matchers.
|
|
25
|
+
* The other components of the [identifier][id] are matched by equality.
|
|
26
|
+
source_artifact_url (str | None): The source artifact this configuration applies to.
|
|
27
|
+
vcs (VcsMatcher | None): The vcs and revision this configuration applies to.
|
|
28
|
+
source_code_origin (SourceCodeOrigin | None): The source code origin this configuration
|
|
29
|
+
applies to.
|
|
30
|
+
path_excludes (list[PathExclude]): Path excludes.
|
|
31
|
+
license_finding_curations (list[LicenseFindingCuration]): License finding curations.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
extra="forbid",
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
id: Identifier = Field(
|
|
39
|
+
description="The [Identifier] which must match with the identifier of the package in order for this package"
|
|
40
|
+
"curation to apply. The [version][Identifier.version] can be either a plain version string matched for"
|
|
41
|
+
"equality, or an Ivy-style version matchers."
|
|
42
|
+
"* The other components of the [identifier][id] are matched by equality.",
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
source_artifact_url: str | None = Field(
|
|
46
|
+
default=None,
|
|
47
|
+
description="The source artifact this configuration applies to.",
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
vcs: VcsMatcher | None = Field(
|
|
51
|
+
default=None,
|
|
52
|
+
description="The vcs and revision this configuration applies to.",
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
source_code_origin: SourceCodeOrigin | None = Field(
|
|
56
|
+
default=None,
|
|
57
|
+
description="The source code origin this configuration applies to.",
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
path_excludes: list[PathExclude] = Field(
|
|
61
|
+
default_factory=list,
|
|
62
|
+
description="Path excludes.",
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
license_finding_curations: list[LicenseFindingCuration] = Field(
|
|
66
|
+
default_factory=list,
|
|
67
|
+
description="License finding curations.",
|
|
68
|
+
)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2025 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class PackageManagerConfiguration(BaseModel):
|
|
9
|
+
model_config = ConfigDict(
|
|
10
|
+
extra="forbid",
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
must_run_after: list[str] | None = Field(
|
|
14
|
+
default=None,
|
|
15
|
+
description="The configuration model for a package manager. This class is (de-)serialized in the following"
|
|
16
|
+
"places:"
|
|
17
|
+
"- Deserialized from config.yml as part of [OrtConfiguration] (via Hoplite)."
|
|
18
|
+
"- Deserialized from .ort.yml as part of [RepositoryAnalyzerConfiguration] (via Jackson)"
|
|
19
|
+
"- (De-)Serialized as part of [org.ossreviewtoolkit.model.OrtResult] (via Jackson).",
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
options: dict[str, str] | None = Field(
|
|
23
|
+
default=None,
|
|
24
|
+
description="Custom configuration options for the package manager. See the documentation of the respective"
|
|
25
|
+
"class for available options.",
|
|
26
|
+
)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2025 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
6
|
+
|
|
7
|
+
from ort.models.config.path_exclude_reason import PathExcludeReason
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class PathExclude(BaseModel):
|
|
11
|
+
"""
|
|
12
|
+
Defines paths which should be excluded. Each file or directory that is matched by the [glob][pattern] is marked as
|
|
13
|
+
excluded. If a project definition file is matched by the [pattern], the whole project is excluded. For details about
|
|
14
|
+
the glob syntax see the [FileMatcher] implementation.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
model_config = ConfigDict(
|
|
18
|
+
extra="forbid",
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
pattern: str = Field(
|
|
22
|
+
description="A glob to match the path of the project definition file, relative to the root of the repository."
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
reason: PathExcludeReason = Field(
|
|
26
|
+
description="The reason why the project is excluded, out of a predefined choice.",
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
comment: str = Field(
|
|
30
|
+
default_factory=str,
|
|
31
|
+
description="A comment to further explain why the [reason] is applicable here.",
|
|
32
|
+
)
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2025 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
from enum import Enum, auto
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class PathExcludeReason(Enum):
|
|
8
|
+
"""
|
|
9
|
+
Possible reasons for excluding a path.
|
|
10
|
+
Attributes
|
|
11
|
+
BUILD_TOOL_OF
|
|
12
|
+
The path only contains tools used for building source code which are not included in
|
|
13
|
+
distributed build artifacts.
|
|
14
|
+
|
|
15
|
+
DATA_FILE_OF
|
|
16
|
+
The path only contains data files such as fonts or images which are not included in
|
|
17
|
+
distributed build artifacts.
|
|
18
|
+
|
|
19
|
+
DOCUMENTATION_OF
|
|
20
|
+
The path only contains documentation which is not included in distributed build artifacts.
|
|
21
|
+
|
|
22
|
+
EXAMPLE_OF
|
|
23
|
+
The path only contains source code examples which are not included in distributed build
|
|
24
|
+
artifacts.
|
|
25
|
+
|
|
26
|
+
OPTIONAL_COMPONENT_OF
|
|
27
|
+
The path only contains optional components for the code that is built which are not included
|
|
28
|
+
in distributed build artifacts.
|
|
29
|
+
|
|
30
|
+
OTHER
|
|
31
|
+
Any other reason which cannot be represented by any other element of PathExcludeReason.
|
|
32
|
+
|
|
33
|
+
PROVIDED_BY
|
|
34
|
+
The path only contains packages or sources for packages that have to be provided by the user
|
|
35
|
+
of distributed build artifacts.
|
|
36
|
+
|
|
37
|
+
TEST_OF
|
|
38
|
+
The path only contains files used for testing source code which are not included in
|
|
39
|
+
distributed build artifacts.
|
|
40
|
+
|
|
41
|
+
TEST_TOOL_OF
|
|
42
|
+
The path only contains tools used for testing source code which are not included in
|
|
43
|
+
distributed build artifacts.
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
# The path only contains tools used for building source code which are not included in distributed build artifacts.
|
|
47
|
+
BUILD_TOOL_OF = auto()
|
|
48
|
+
|
|
49
|
+
# The path only contains data files such as fonts or images which are not included in distributed build artifacts.
|
|
50
|
+
DATA_FILE_OF = auto()
|
|
51
|
+
|
|
52
|
+
# The path only contains documentation which is not included in distributed build artifacts.
|
|
53
|
+
DOCUMENTATION_OF = auto()
|
|
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()
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2025 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
6
|
+
|
|
7
|
+
from ort.models.config.package_manager_configuration import PackageManagerConfiguration
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class RepositoryAnalyzerConfiguration(BaseModel):
|
|
11
|
+
"""
|
|
12
|
+
Enable the analysis of projects that use version ranges to declare their dependencies. If set to true,
|
|
13
|
+
dependencies of exactly the same project might change with another scan done at a later time if any of the
|
|
14
|
+
(transitive) dependencies are declared using version ranges and a new version of such a dependency was
|
|
15
|
+
published in the meantime. If set to false, analysis of projects that use version ranges will fail. Defaults to
|
|
16
|
+
false.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
model_config = ConfigDict(
|
|
20
|
+
extra="forbid",
|
|
21
|
+
)
|
|
22
|
+
allow_dynamic_versions: bool | None = Field(
|
|
23
|
+
default=None,
|
|
24
|
+
description="Enable the analysis of projects that use version ranges to declare their dependencies."
|
|
25
|
+
"If set to true, dependencies of exactly the same project might change with another scan done at a later time"
|
|
26
|
+
"if any of the (transitive) dependencies are declared using version ranges and a new version of such a"
|
|
27
|
+
"dependency was published in the meantime. If set to false, analysis of projects that use version ranges will"
|
|
28
|
+
"fail. Defaults to false.",
|
|
29
|
+
)
|
|
30
|
+
enabled_package_managers: list[str] | None = Field(
|
|
31
|
+
default=None,
|
|
32
|
+
description="A list of the case-insensitive names of package managers that are enabled."
|
|
33
|
+
"Disabling a package manager in [disabledPackageManagers] overrides enabling it here.",
|
|
34
|
+
)
|
|
35
|
+
disabled_package_managers: list[str] | None = Field(
|
|
36
|
+
default=None,
|
|
37
|
+
description="A list of the case-insensitive names of package managers that are disabled."
|
|
38
|
+
"Disabling a package manager in this list overrides [enabledPackageManagers].",
|
|
39
|
+
)
|
|
40
|
+
package_managers: dict[str, PackageManagerConfiguration] | None = Field(
|
|
41
|
+
default=None,
|
|
42
|
+
description="Get a [PackageManagerConfiguration] from [packageManagers]. The difference to accessing the map"
|
|
43
|
+
"directly is that [packageManager] can be case-insensitive.",
|
|
44
|
+
)
|
|
45
|
+
skip_excluded: bool | None = Field(
|
|
46
|
+
default=None,
|
|
47
|
+
description="A flag to control whether excluded scopes and paths should be skipped during the analysis.",
|
|
48
|
+
)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2025 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
from pydantic import AnyUrl, BaseModel, ConfigDict, Field
|
|
6
|
+
|
|
7
|
+
from ort.models.vcstype import VcsType
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class VcsMatcher(BaseModel):
|
|
11
|
+
"""
|
|
12
|
+
A matcher which matches its properties against a [RepositoryProvenance].
|
|
13
|
+
|
|
14
|
+
Attributes:
|
|
15
|
+
orttype (VcsType): The [type] to match for equality against [VcsInfo.type].
|
|
16
|
+
url (AnyUrl): The [url] to match for equality against [VcsInfo.url].
|
|
17
|
+
revision (str | None): The revision to match for equality against [RepositoryProvenance.resolvedRevision],
|
|
18
|
+
or null to match any revision.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
model_config = ConfigDict(
|
|
22
|
+
extra="forbid",
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
orttype: VcsType = Field(
|
|
26
|
+
alias="type",
|
|
27
|
+
description="The [type] to match for equality against [VcsInfo.type].",
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
url: AnyUrl = Field(
|
|
31
|
+
description="The [url] to match for equality against [VcsInfo.url].",
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
revision: str | None = Field(
|
|
35
|
+
default=None,
|
|
36
|
+
description="The revision to match for equality against [RepositoryProvenance.resolvedRevision],"
|
|
37
|
+
"or null to match anyrevision.",
|
|
38
|
+
)
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2025 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
from typing import ClassVar
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, Field, model_validator
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class HashAlgorithm(BaseModel):
|
|
10
|
+
"""
|
|
11
|
+
A Python port of the Kotlin HashAlgorithm enum class.
|
|
12
|
+
|
|
13
|
+
Each algorithm has one or more aliases, an empty hash value,
|
|
14
|
+
and an 'is_verifiable' flag.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
aliases: list[str] = Field(default_factory=list)
|
|
18
|
+
empty_value: str = ""
|
|
19
|
+
is_verifiable: bool = True
|
|
20
|
+
|
|
21
|
+
# ---- known algorithms ----
|
|
22
|
+
NONE: ClassVar["HashAlgorithm"]
|
|
23
|
+
UNKNOWN: ClassVar["HashAlgorithm"]
|
|
24
|
+
MD5: ClassVar["HashAlgorithm"]
|
|
25
|
+
SHA1: ClassVar["HashAlgorithm"]
|
|
26
|
+
SHA256: ClassVar["HashAlgorithm"]
|
|
27
|
+
SHA384: ClassVar["HashAlgorithm"]
|
|
28
|
+
SHA512: ClassVar["HashAlgorithm"]
|
|
29
|
+
SHA1GIT: ClassVar["HashAlgorithm"]
|
|
30
|
+
|
|
31
|
+
# ---- derived property ----
|
|
32
|
+
@property
|
|
33
|
+
def size(self) -> int:
|
|
34
|
+
"""The length of the empty hash string for this algorithm."""
|
|
35
|
+
return len(self.empty_value)
|
|
36
|
+
|
|
37
|
+
# ---- validation ----
|
|
38
|
+
@model_validator(mode="before")
|
|
39
|
+
@classmethod
|
|
40
|
+
def _from_alias(cls, value):
|
|
41
|
+
"""Allow initialization from alias string."""
|
|
42
|
+
if isinstance(value, str):
|
|
43
|
+
algo = cls.from_string(value)
|
|
44
|
+
return algo.model_dump()
|
|
45
|
+
return value
|
|
46
|
+
|
|
47
|
+
# ---- class methods ----
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_string(cls, alias: str) -> "HashAlgorithm":
|
|
50
|
+
"""Find a HashAlgorithm by alias name (case-insensitive)."""
|
|
51
|
+
alias_upper = alias.upper()
|
|
52
|
+
for algo in cls._entries():
|
|
53
|
+
if any(a.upper() == alias_upper for a in algo.aliases):
|
|
54
|
+
return algo
|
|
55
|
+
return cls.UNKNOWN
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def create(cls, value: str) -> "HashAlgorithm":
|
|
59
|
+
"""
|
|
60
|
+
Create a HashAlgorithm from a hash value string, based on its length.
|
|
61
|
+
Returns NONE if value is blank, UNKNOWN otherwise.
|
|
62
|
+
"""
|
|
63
|
+
if not value.strip():
|
|
64
|
+
return cls.NONE
|
|
65
|
+
for algo in cls._entries():
|
|
66
|
+
if len(value) == algo.size:
|
|
67
|
+
return algo
|
|
68
|
+
return cls.UNKNOWN
|
|
69
|
+
|
|
70
|
+
@classmethod
|
|
71
|
+
def _entries(cls) -> list["HashAlgorithm"]:
|
|
72
|
+
"""Return the list of all defined algorithms."""
|
|
73
|
+
return [
|
|
74
|
+
cls.NONE,
|
|
75
|
+
cls.UNKNOWN,
|
|
76
|
+
cls.MD5,
|
|
77
|
+
cls.SHA1,
|
|
78
|
+
cls.SHA256,
|
|
79
|
+
cls.SHA384,
|
|
80
|
+
cls.SHA512,
|
|
81
|
+
cls.SHA1GIT,
|
|
82
|
+
]
|
|
83
|
+
|
|
84
|
+
def __str__(self) -> str:
|
|
85
|
+
return self.aliases[0] if self.aliases else ""
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
HashAlgorithm.NONE = HashAlgorithm(aliases=[""], empty_value="", is_verifiable=False)
|
|
89
|
+
HashAlgorithm.UNKNOWN = HashAlgorithm(aliases=["UNKNOWN"], empty_value="", is_verifiable=False)
|
|
90
|
+
HashAlgorithm.MD5 = HashAlgorithm(
|
|
91
|
+
aliases=["MD5"],
|
|
92
|
+
empty_value="d41d8cd98f00b204e9800998ecf8427e",
|
|
93
|
+
)
|
|
94
|
+
HashAlgorithm.SHA1 = HashAlgorithm(
|
|
95
|
+
aliases=["SHA-1", "SHA1"],
|
|
96
|
+
empty_value="da39a3ee5e6b4b0d3255bfef95601890afd80709",
|
|
97
|
+
)
|
|
98
|
+
HashAlgorithm.SHA256 = HashAlgorithm(
|
|
99
|
+
aliases=["SHA-256", "SHA256"],
|
|
100
|
+
empty_value="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
|
101
|
+
)
|
|
102
|
+
HashAlgorithm.SHA384 = HashAlgorithm(
|
|
103
|
+
aliases=["SHA-384", "SHA384"],
|
|
104
|
+
empty_value=("38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b"),
|
|
105
|
+
)
|
|
106
|
+
HashAlgorithm.SHA512 = HashAlgorithm(
|
|
107
|
+
aliases=["SHA-512", "SHA512"],
|
|
108
|
+
empty_value=(
|
|
109
|
+
"cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce"
|
|
110
|
+
"47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e"
|
|
111
|
+
),
|
|
112
|
+
)
|
|
113
|
+
HashAlgorithm.SHA1GIT = HashAlgorithm(
|
|
114
|
+
aliases=["SHA-1-GIT", "SHA1-GIT", "SHA1GIT", "SWHID"],
|
|
115
|
+
empty_value="e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
|
|
116
|
+
)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2025 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
from pydantic import BaseModel, ConfigDict, Field, model_validator
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Identifier(BaseModel):
|
|
11
|
+
"""
|
|
12
|
+
A unique identifier for a software component.
|
|
13
|
+
|
|
14
|
+
Attributes:
|
|
15
|
+
orttype (str): The type of component this identifier describes. When used in the context of a [Project],
|
|
16
|
+
the type equals the one of the package manager that manages the project (e.g. 'Gradle'
|
|
17
|
+
for a Gradle project). When used in the context of a [Package], the type is the name
|
|
18
|
+
of the artifact ecosystem (e.g. 'Maven' for a file from a Maven repository).
|
|
19
|
+
namespace (str): The namespace of the component, for example the group for 'Maven' or the scope for 'NPM'.
|
|
20
|
+
name (str): The name of the component.
|
|
21
|
+
version (str): The version of the component.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
model_config = ConfigDict(
|
|
25
|
+
extra="forbid",
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
orttype: str = Field(
|
|
29
|
+
alias="type",
|
|
30
|
+
description="The type of component this identifier describes. When used in the context of a [Project],"
|
|
31
|
+
"the type equals the one of the package manager that manages the project (e.g. 'Gradle' "
|
|
32
|
+
"for a Gradle project). When used in the context of a [Package], the type is the name"
|
|
33
|
+
"of the artifact ecosystem (e.g. 'Maven' for a file from a Maven repository).",
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
namespace: str = Field(
|
|
37
|
+
description="The namespace of the component, for examplethe group for 'Maven' or the scope for 'NPM'.",
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
name: str = Field(
|
|
41
|
+
description="The name of the component.",
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
version: str = Field(
|
|
45
|
+
description="The version of the component.",
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
@model_validator(mode="before")
|
|
49
|
+
@classmethod
|
|
50
|
+
def parse_string_or_dict(cls, value: Any):
|
|
51
|
+
if isinstance(value, dict):
|
|
52
|
+
return value
|
|
53
|
+
if isinstance(value, str):
|
|
54
|
+
parts = value.split(":")
|
|
55
|
+
if len(parts) != 4:
|
|
56
|
+
raise ValueError("Identifier string must be in the format 'type:namespace:name:version'")
|
|
57
|
+
return {
|
|
58
|
+
"type": parts[0],
|
|
59
|
+
"namespace": parts[1],
|
|
60
|
+
"name": parts[2],
|
|
61
|
+
"version": parts[3],
|
|
62
|
+
}
|
|
63
|
+
raise TypeError("Identifier must be a dict or a string in the correct format")
|
|
@@ -11,8 +11,6 @@ import yaml
|
|
|
11
11
|
import yaml.parser
|
|
12
12
|
from pydantic import AnyUrl, BaseModel, ConfigDict, Field, RootModel
|
|
13
13
|
|
|
14
|
-
from .package_managers import OrtPackageManagerConfigurations, OrtPackageManagers
|
|
15
|
-
|
|
16
14
|
|
|
17
15
|
class AdvisorConfig(RootModel[dict[str, dict[str, Any]] | None]):
|
|
18
16
|
root: dict[str, dict[str, Any]] | None = None
|
|
@@ -200,9 +198,10 @@ class AnalyzerConfigurationSchema(BaseModel):
|
|
|
200
198
|
extra="forbid",
|
|
201
199
|
)
|
|
202
200
|
allow_dynamic_versions: Annotated[bool | None, Field(alias="allowDynamicVersions")] = None
|
|
203
|
-
enabled_package_managers: Annotated[list[
|
|
204
|
-
disabled_package_managers: Annotated[list[OrtPackageManagers] | None,
|
|
205
|
-
|
|
201
|
+
# enabled_package_managers: Annotated[list[PackageManager] | None, Field(alias="enabledPackageManagers")] = None
|
|
202
|
+
# # disabled_package_managers: Annotated[list[OrtPackageManagers] | None,
|
|
203
|
+
# Field(alias="disabledPackageManagers")] = None
|
|
204
|
+
# package_managers: Annotated[OrtPackageManagerConfigurations | None, Field(alias="packageManagers")] = None
|
|
206
205
|
sw360_configuration: Annotated[Sw360Configuration | None, Field(alias="sw360Configuration")] = None
|
|
207
206
|
skip_excluded: Annotated[bool | None, Field(alias="skipExcluded")] = None
|
|
208
207
|
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2025 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
from pydantic import AnyUrl, BaseModel, ConfigDict, Field
|
|
7
|
+
|
|
8
|
+
from .hash import Hash
|
|
9
|
+
from .source_code_origin import SourceCodeOrigin
|
|
10
|
+
from .vcsinfo_curation_data import VcsInfoCurationData
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class CurationArtifact(BaseModel):
|
|
14
|
+
url: AnyUrl
|
|
15
|
+
hash: Hash
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class PackageCurationData(BaseModel):
|
|
19
|
+
"""
|
|
20
|
+
Data model for package curation data.
|
|
21
|
+
|
|
22
|
+
Attributes:
|
|
23
|
+
comment (str | None): Optional comment about the curation.
|
|
24
|
+
purl (str | None): The package URL (PURL) identifying the package.
|
|
25
|
+
cpe (str | None): The Common Platform Enumeration (CPE) identifier.
|
|
26
|
+
authors (list[str] | None): List of authors of the package.
|
|
27
|
+
concluded_license (str | None): The license concluded for the package.
|
|
28
|
+
description (str | None): Description of the package.
|
|
29
|
+
homepage_url (str | None): URL of the package's homepage.
|
|
30
|
+
binary_artifact (CurationArtifact | None): Information about the binary artifact.
|
|
31
|
+
source_artifact (CurationArtifact | None): Information about the source artifact.
|
|
32
|
+
vcs (VcsInfoCurationData | None): Version control system information.
|
|
33
|
+
is_metadata_only (bool | None): Whether the curation is metadata only.
|
|
34
|
+
is_modified (bool | None): Whether the package has been modified.
|
|
35
|
+
declared_license_mapping (dict[str, Any]): Mapping of declared licenses.
|
|
36
|
+
source_code_origins (list[SourceCodeOrigin] | None): List of source code origins.
|
|
37
|
+
labels (dict[str, str]): Additional labels for the package.
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
model_config = ConfigDict(
|
|
41
|
+
extra="forbid",
|
|
42
|
+
)
|
|
43
|
+
comment: str | None = None
|
|
44
|
+
purl: str | None = None
|
|
45
|
+
cpe: str | None = None
|
|
46
|
+
authors: list[str] | None = None
|
|
47
|
+
concluded_license: str | None = None
|
|
48
|
+
description: str | None = None
|
|
49
|
+
homepage_url: str | None = None
|
|
50
|
+
binary_artifact: CurationArtifact | None = None
|
|
51
|
+
source_artifact: CurationArtifact | None = None
|
|
52
|
+
vcs: VcsInfoCurationData | None = None
|
|
53
|
+
is_metadata_only: bool | None = None
|
|
54
|
+
is_modified: bool | None = None
|
|
55
|
+
declared_license_mapping: dict[str, Any] = Field(default_factory=dict)
|
|
56
|
+
source_code_origins: list[SourceCodeOrigin] | None = None
|
|
57
|
+
labels: dict[str, str] = Field(default_factory=dict)
|
|
@@ -7,9 +7,9 @@ from typing import Any
|
|
|
7
7
|
|
|
8
8
|
from pydantic import BaseModel, Field, RootModel
|
|
9
9
|
|
|
10
|
-
from ort.models.analyzer_configurations import OrtAnalyzerConfigurations
|
|
11
10
|
from ort.models.config.curations import Curations
|
|
12
|
-
from ort.models.
|
|
11
|
+
from ort.models.config.package_configuration import PackageConfiguration
|
|
12
|
+
from ort.models.config.repository_analyzer_configuration import RepositoryAnalyzerConfiguration
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class OrtRepositoryConfigurationLicenseChoicesPackageLicenseChoiceLicenseChoice(BaseModel):
|
|
@@ -170,10 +170,6 @@ class OrtRepositoryConfigurationSnippetChoice(BaseModel):
|
|
|
170
170
|
choices: list[OrtRepositoryConfigurationSnippetChoiceChoice]
|
|
171
171
|
|
|
172
172
|
|
|
173
|
-
class PackageManagerConfigurationSchema(RootModel[dict[str, PackageManagerConfigs]]):
|
|
174
|
-
root: dict[str, PackageManagerConfigs]
|
|
175
|
-
|
|
176
|
-
|
|
177
173
|
class ResolutionsSchemaResolutionsSchemaIssue(BaseModel):
|
|
178
174
|
message: str
|
|
179
175
|
reason: IssueResolutionReason
|
|
@@ -277,7 +273,7 @@ class OrtRepositoryConfiguration(BaseModel):
|
|
|
277
273
|
Each field corresponds to a specific aspect of the repository's configuration.
|
|
278
274
|
"""
|
|
279
275
|
|
|
280
|
-
analyzer:
|
|
276
|
+
analyzer: RepositoryAnalyzerConfiguration | None = Field(
|
|
281
277
|
None,
|
|
282
278
|
description="Define Analyzer specific options",
|
|
283
279
|
)
|
|
@@ -295,8 +291,8 @@ class OrtRepositoryConfiguration(BaseModel):
|
|
|
295
291
|
description="Defines curations for packages used as dependencies by projects in this repository,"
|
|
296
292
|
" or curations for license findings in the source code of a project in this repository.",
|
|
297
293
|
)
|
|
298
|
-
package_configurations: list[
|
|
299
|
-
|
|
294
|
+
package_configurations: list[PackageConfiguration] = Field(
|
|
295
|
+
default_factory=list,
|
|
300
296
|
description="A configuration for a specific package and provenance.",
|
|
301
297
|
)
|
|
302
298
|
license_choices: OrtRepositoryConfigurationLicenseChoices | None = Field(
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: 2025 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
-
#
|
|
3
|
-
# SPDX-License-Identifier: MIT
|
|
4
|
-
|
|
5
|
-
from ort.models.analyzer_configurations import OrtAnalyzerConfigurations
|
|
6
|
-
from ort.models.ort_configuration import OrtConfiguration, Scanner, Severity, Storages
|
|
7
|
-
from ort.models.package_managers import OrtPackageManagerConfigurations, OrtPackageManagers
|
|
8
|
-
from ort.models.repository_configuration import OrtRepositoryConfiguration
|
|
9
|
-
|
|
10
|
-
__all__ = [
|
|
11
|
-
"OrtAnalyzerConfigurations",
|
|
12
|
-
"OrtConfiguration",
|
|
13
|
-
"OrtPackageManagerConfigurations",
|
|
14
|
-
"OrtPackageManagers",
|
|
15
|
-
"OrtRepositoryConfiguration",
|
|
16
|
-
"Scanner",
|
|
17
|
-
"Severity",
|
|
18
|
-
"Storages",
|
|
19
|
-
]
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: 2025 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
-
# SPDX-License-Identifier: MIT
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
from pydantic import AnyUrl, BaseModel, ConfigDict, Field
|
|
6
|
-
|
|
7
|
-
from .package_managers import OrtPackageManagerConfigurations, OrtPackageManagers
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class Sw360Configuration(BaseModel):
|
|
11
|
-
model_config = ConfigDict(
|
|
12
|
-
extra="forbid",
|
|
13
|
-
)
|
|
14
|
-
rest_url: AnyUrl = Field(..., alias="restUrl")
|
|
15
|
-
auth_url: AnyUrl = Field(..., alias="authUrl")
|
|
16
|
-
username: str
|
|
17
|
-
password: str | None = None
|
|
18
|
-
client_id: str = Field(..., alias="clientId")
|
|
19
|
-
client_password: str | None = Field(None, alias="clientPassword")
|
|
20
|
-
token: str | None = None
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
class OrtAnalyzerConfigurations(BaseModel):
|
|
24
|
-
model_config = ConfigDict(
|
|
25
|
-
extra="forbid",
|
|
26
|
-
)
|
|
27
|
-
allow_dynamic_versions: bool | None = Field(None)
|
|
28
|
-
enabled_package_managers: list[OrtPackageManagers] | None = Field(None)
|
|
29
|
-
disabled_package_managers: list[OrtPackageManagers] | None = Field(None)
|
|
30
|
-
package_managers: OrtPackageManagerConfigurations | None = Field(None)
|
|
31
|
-
sw360_configuration: Sw360Configuration | None = Field(None)
|
|
32
|
-
skip_excluded: bool | None = Field(None)
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: 2025 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
-
#
|
|
3
|
-
# SPDX-License-Identifier: MIT
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
from enum import Enum
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class HashAlgorithm(Enum):
|
|
10
|
-
"""
|
|
11
|
-
An enum of supported hash algorithms. Each algorithm has one or more [aliases] associated to it,
|
|
12
|
-
where the first alias is the definite name.
|
|
13
|
-
|
|
14
|
-
Attributes:
|
|
15
|
-
NONE: No hash algorithm.
|
|
16
|
-
UNKNOWN: An unknown hash algorithm.
|
|
17
|
-
MD5: The Message-Digest 5 hash algorithm, see [MD5](http://en.wikipedia.org/wiki/MD5).
|
|
18
|
-
SHA1: The Secure Hash Algorithm 1, see [SHA-1](https://en.wikipedia.org/wiki/SHA-1).
|
|
19
|
-
SHA256: The Secure Hash Algorithm 2 with 256 bits, see [SHA-256](https://en.wikipedia.org/wiki/SHA-256).
|
|
20
|
-
SHA384: The Secure Hash Algorithm 2 with 384 bits, see [SHA-384](https://en.wikipedia.org/wiki/SHA-384).
|
|
21
|
-
SHA512: The Secure Hash Algorithm 2 with 512 bits, see [SHA-512](https://en.wikipedia.org/wiki/SHA-512).
|
|
22
|
-
SHA1GIT: The Secure Hash Algorithm 1, but calculated on a Git "blob" object, see
|
|
23
|
-
- https://git-scm.com/book/en/v2/Git-Internals-Git-Objects#_object_storage
|
|
24
|
-
- https://docs.softwareheritage.org/devel/swh-model/persistent-identifiers.html#git-compatibility
|
|
25
|
-
"""
|
|
26
|
-
|
|
27
|
-
NONE = "NONE"
|
|
28
|
-
UNKNOWN = "UNKNOWN"
|
|
29
|
-
MD5 = "MD5"
|
|
30
|
-
SHA1 = "SHA1"
|
|
31
|
-
SHA256 = "SHA256"
|
|
32
|
-
SHA384 = "SHA384"
|
|
33
|
-
SHA512 = "SHA512"
|
|
34
|
-
SHA1GIT = (
|
|
35
|
-
["SHA-1-GIT", "SHA1-GIT", "SHA1GIT", "SWHID"],
|
|
36
|
-
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
|
|
37
|
-
)
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: 2025 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
-
# SPDX-License-Identifier: MIT
|
|
3
|
-
|
|
4
|
-
from typing import Any
|
|
5
|
-
|
|
6
|
-
from pydantic import AnyUrl, BaseModel, ConfigDict, Field
|
|
7
|
-
|
|
8
|
-
from .hash import Hash
|
|
9
|
-
from .source_code_origin import SourceCodeOrigin
|
|
10
|
-
from .vcsinfo_curation_data import VcsInfoCurationData
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class CurationArtifact(BaseModel):
|
|
14
|
-
url: AnyUrl
|
|
15
|
-
hash: Hash
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class PackageCurationData(BaseModel):
|
|
19
|
-
model_config = ConfigDict(
|
|
20
|
-
extra="forbid",
|
|
21
|
-
)
|
|
22
|
-
comment: str | None = None
|
|
23
|
-
purl: str | None = None
|
|
24
|
-
cpe: str | None = None
|
|
25
|
-
authors: list[str] | None = None
|
|
26
|
-
concluded_license: str | None = None
|
|
27
|
-
description: str | None = None
|
|
28
|
-
homepage_url: str | None = None
|
|
29
|
-
binary_artifact: CurationArtifact | None = None
|
|
30
|
-
source_artifact: CurationArtifact | None = None
|
|
31
|
-
vcs: VcsInfoCurationData | None = None
|
|
32
|
-
is_metadata_only: bool | None = None
|
|
33
|
-
is_modified: bool | None = None
|
|
34
|
-
declared_license_mapping: dict[str, Any] = Field(default_factory=dict)
|
|
35
|
-
source_code_origins: list[SourceCodeOrigin] | None = None
|
|
36
|
-
labels: dict[str, str] = Field(default_factory=dict)
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: 2025 Helio Chissini de Castro <heliocastro@gmail.com>
|
|
2
|
-
# SPDX-License-Identifier: MIT
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
from enum import Enum
|
|
6
|
-
from typing import Any
|
|
7
|
-
|
|
8
|
-
from pydantic import BaseModel, ConfigDict, Field, RootModel
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class OrtPackageManagers(Enum):
|
|
12
|
-
"""
|
|
13
|
-
Enumeration of supported package managers in ORT.
|
|
14
|
-
|
|
15
|
-
This enum represents a variety of package managers across different programming ecosystems.
|
|
16
|
-
"""
|
|
17
|
-
|
|
18
|
-
bazel = "Bazel"
|
|
19
|
-
bower = "Bower"
|
|
20
|
-
bundler = "Bundler"
|
|
21
|
-
cargo = "Cargo"
|
|
22
|
-
carthage = "Carthage"
|
|
23
|
-
cocoa_pods = "CocoaPods"
|
|
24
|
-
composer = "Composer"
|
|
25
|
-
conan = "Conan"
|
|
26
|
-
go_mod = "GoMod"
|
|
27
|
-
gradle = "Gradle"
|
|
28
|
-
gradle_inspector = "GradleInspector"
|
|
29
|
-
maven = "Maven"
|
|
30
|
-
npm = "NPM"
|
|
31
|
-
nu_get = "NuGet"
|
|
32
|
-
pip = "PIP"
|
|
33
|
-
pipenv = "Pipenv"
|
|
34
|
-
pnpm = "PNPM"
|
|
35
|
-
poetry = "Poetry"
|
|
36
|
-
pub = "Pub"
|
|
37
|
-
sbt = "SBT"
|
|
38
|
-
spdx_document_file = "SpdxDocumentFile"
|
|
39
|
-
stack = "Stack"
|
|
40
|
-
swift_pm = "SwiftPM"
|
|
41
|
-
unmanaged = "Unmanaged"
|
|
42
|
-
yarn = "Yarn"
|
|
43
|
-
yarn2 = "Yarn2"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
class PackageManagerConfigs(BaseModel):
|
|
47
|
-
model_config = ConfigDict(
|
|
48
|
-
extra="forbid",
|
|
49
|
-
)
|
|
50
|
-
must_run_after: list[OrtPackageManagers] | None = Field(None, alias="mustRunAfter")
|
|
51
|
-
options: Any | None = None
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
class OrtPackageManagerConfigurations(RootModel[dict[str, PackageManagerConfigs]]):
|
|
55
|
-
root: dict[str, PackageManagerConfigs]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_ort-0.3.1 → python_ort-0.4.1}/src/ort/models/config/license_finding_curation_reason.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|