python-ort 0.1.1__tar.gz → 0.2.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-ort
3
- Version: 0.1.1
3
+ Version: 0.2.0
4
4
  Summary: A Python Ort model serialization library
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
@@ -10,9 +10,9 @@ Classifier: Programming Language :: Python :: 3 :: Only
10
10
  Classifier: Programming Language :: Python :: 3.10
11
11
  Classifier: Programming Language :: Python :: 3.11
12
12
  Classifier: Programming Language :: Python :: 3.12
13
- Classifier: Programming Language :: Python :: 3.14
13
+ Classifier: Programming Language :: Python :: 3.13
14
14
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
15
- Requires-Dist: pydantic>=2.11.10
15
+ Requires-Dist: pydantic>=2.12.4
16
16
  Requires-Dist: pyyaml>=6.0.3
17
17
  Requires-Python: >=3.10
18
18
  Description-Content-Type: text/markdown
@@ -1,5 +1,5 @@
1
1
  [build-system]
2
- requires = ["uv_build>=0.8.12,<0.9.0"]
2
+ requires = ["uv_build>=0.8.12,<0.10.0"]
3
3
  build-backend = "uv_build"
4
4
 
5
5
  [tool.hatch.build.targets.wheel]
@@ -7,14 +7,14 @@ packages = ["src/ort"]
7
7
 
8
8
  [project]
9
9
  name = "python-ort"
10
- version = "0.1.1"
10
+ version = "0.2.0"
11
11
  description = "A Python Ort model serialization library"
12
12
  readme = "README.md"
13
13
  license = "MIT"
14
14
  license-files = ["LICENSE"]
15
15
  requires-python = ">=3.10"
16
16
  dependencies = [
17
- "pydantic>=2.11.10",
17
+ "pydantic>=2.12.4",
18
18
  "pyyaml>=6.0.3",
19
19
  ]
20
20
  classifiers = [
@@ -24,7 +24,7 @@ classifiers = [
24
24
  "Programming Language :: Python :: 3.10",
25
25
  "Programming Language :: Python :: 3.11",
26
26
  "Programming Language :: Python :: 3.12",
27
- "Programming Language :: Python :: 3.14",
27
+ "Programming Language :: Python :: 3.13",
28
28
  "Topic :: Software Development :: Libraries :: Python Modules",
29
29
  ]
30
30
 
@@ -34,12 +34,12 @@ module-root = "src"
34
34
 
35
35
  [dependency-groups]
36
36
  dev = [
37
- "datamodel-code-generator[http]>=0.34.0",
37
+ "datamodel-code-generator[http]>=0.35.0",
38
38
  "pre-commit>=4.3.0",
39
39
  "pycodestyle>=2.14.0",
40
- "pyrefly>=0.35.0",
40
+ "pyrefly>=0.40.0",
41
41
  "pytest>=8.4.2",
42
- "ruff>=0.13.3",
42
+ "ruff>=0.14.3",
43
43
  "types-pyyaml>=6.0.12.20250915",
44
44
  ]
45
45
 
@@ -162,4 +162,5 @@ skip-magic-trailing-comma = false
162
162
  [tool.pyrefly]
163
163
  project_includes = [
164
164
  "src/ort/**",
165
+ "tests/**",
165
166
  ]
@@ -4,14 +4,15 @@
4
4
 
5
5
  from ort.models.analyzer_configurations import OrtAnalyzerConfigurations
6
6
  from ort.models.ort_configuration import OrtConfiguration, Scanner, Severity, Storages
7
- from ort.models.package_manager_configurations import OrtPackageManagerConfigurations
8
- from ort.models.package_managers import OrtPackageManagers
7
+ from ort.models.package_managers import OrtPackageManagerConfigurations, OrtPackageManagers
8
+ from ort.models.repository_configuration import OrtRepositoryConfiguration
9
9
 
10
10
  __all__ = [
11
11
  "OrtAnalyzerConfigurations",
12
+ "OrtConfiguration",
12
13
  "OrtPackageManagerConfigurations",
13
14
  "OrtPackageManagers",
14
- "OrtConfiguration",
15
+ "OrtRepositoryConfiguration",
15
16
  "Scanner",
16
17
  "Severity",
17
18
  "Storages",
@@ -2,20 +2,9 @@
2
2
  # SPDX-License-Identifier: MIT
3
3
 
4
4
 
5
- from typing import Any
6
-
7
5
  from pydantic import AnyUrl, BaseModel, ConfigDict, Field
8
6
 
9
- from .package_manager_configurations import OrtPackageManagerConfigurations
10
- from .package_managers import OrtPackageManagers
11
-
12
-
13
- class PackageManagerConfigs(BaseModel):
14
- model_config = ConfigDict(
15
- extra="forbid",
16
- )
17
- must_run_after: list[OrtPackageManagers] | None = Field(None, alias="mustRunAfter")
18
- options: Any | None = None
7
+ from .package_managers import OrtPackageManagerConfigurations, OrtPackageManagers
19
8
 
20
9
 
21
10
  class Sw360Configuration(BaseModel):
@@ -35,9 +24,9 @@ class OrtAnalyzerConfigurations(BaseModel):
35
24
  model_config = ConfigDict(
36
25
  extra="forbid",
37
26
  )
38
- allow_dynamic_versions: bool | None = Field(None, alias="allowDynamicVersions")
39
- enabled_package_managers: list[OrtPackageManagers] | None = Field(None, alias="enabledPackageManagers")
40
- disabled_package_managers: list[OrtPackageManagers] | None = Field(None, alias="disabledPackageManagers")
41
- package_managers: OrtPackageManagerConfigurations | None = Field(None, alias="packageManagers")
42
- sw360_configuration: Sw360Configuration | None = Field(None, alias="sw360Configuration")
43
- skip_excluded: bool | None = Field(None, alias="skipExcluded")
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)
@@ -11,8 +11,7 @@ import yaml
11
11
  import yaml.parser
12
12
  from pydantic import AnyUrl, BaseModel, ConfigDict, Field, RootModel
13
13
 
14
- from .package_manager_configurations import OrtPackageManagerConfigurations
15
- from .package_managers import OrtPackageManagers
14
+ from .package_managers import OrtPackageManagerConfigurations, OrtPackageManagers
16
15
 
17
16
 
18
17
  class AdvisorConfig(RootModel[dict[str, dict[str, Any]] | None]):
@@ -3,9 +3,18 @@
3
3
 
4
4
 
5
5
  from enum import Enum
6
+ from typing import Any
7
+
8
+ from pydantic import BaseModel, ConfigDict, Field, RootModel
6
9
 
7
10
 
8
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
+
9
18
  bazel = "Bazel"
10
19
  bower = "Bower"
11
20
  bundler = "Bundler"
@@ -32,3 +41,15 @@ class OrtPackageManagers(Enum):
32
41
  unmanaged = "Unmanaged"
33
42
  yarn = "Yarn"
34
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]
@@ -5,11 +5,11 @@
5
5
  from enum import Enum
6
6
  from typing import Any
7
7
 
8
- from pydantic import BaseModel, ConfigDict, Field, RootModel
8
+ from pydantic import BaseModel, Field, RootModel
9
9
 
10
10
  from .analyzer_configurations import OrtAnalyzerConfigurations
11
- from .package_manager_configurations import OrtPackageManagerConfigurations
12
- from .package_managers import OrtPackageManagers
11
+ from .package_managers import OrtPackageManagerConfigurations, PackageManagerConfigs
12
+ from .source_code_origin import SourceCodeOrigin
13
13
 
14
14
 
15
15
  class OrtRepositoryConfigurationLicenseChoicesPackageLicenseChoiceLicenseChoice(BaseModel):
@@ -41,14 +41,6 @@ class OrtRepositoryConfigurationSnippetChoiceChoiceGiven(BaseModel):
41
41
  source_location: OrtRepositoryConfigurationSnippetChoiceChoiceGivenSourceLocation | None = None
42
42
 
43
43
 
44
- class PackageManagerConfigs(BaseModel):
45
- model_config = ConfigDict(
46
- extra="forbid",
47
- )
48
- must_run_after: list[OrtPackageManagers] | None = None
49
- options: Any | None = None
50
-
51
-
52
44
  class IssueResolutionReason(Enum):
53
45
  build_tool_issue = "BUILD_TOOL_ISSUE"
54
46
  cant_fix_issue = "CANT_FIX_ISSUE"
@@ -302,8 +294,8 @@ class ResolutionsSchema(
302
294
  ResolutionsSchemaResolutionsSchema | ResolutionsSchemaResolutionsSchema1 | ResolutionsSchemaResolutionsSchema2
303
295
  ) = Field(
304
296
  ...,
305
- description="The OSS-Review-Toolkit (ORT) provides a possibility to resolve issues, rule violations and"
306
- "security vulnerabilities in a resolutions file. A full list of all available options can be found at"
297
+ description="The OSS-Review-Toolkit (ORT) provides a possibility to resolve issues, rule violations and "
298
+ "security vulnerabilities in a resolutions file. A full list of all available options can be found at "
307
299
  "https://oss-review-toolkit.org/ort/docs/configuration/resolutions.",
308
300
  title="ORT resolutions",
309
301
  )
@@ -319,18 +311,20 @@ CurationsSchemaCurationsSchemaItemCurationsSourceArtifact = CurationsSchemaCurat
319
311
 
320
312
  class CurationsSchemaCurationsSchemaItemCurations(BaseModel):
321
313
  comment: str | None = None
314
+ purl: str | None = None
315
+ cpe: str | None = None
322
316
  authors: list[str] | None = None
323
317
  concluded_license: str | None = None
324
- cpe: str | None = None
325
- declared_license_mapping: dict[str, Any] | None = None
326
318
  description: str | None = None
327
319
  homepage_url: str | None = None
328
- purl: str | None = None
329
320
  binary_artifact: CurationsSchemaCurationsSchemaItemCurationsBinaryArtifact | None = None
330
321
  source_artifact: CurationsSchemaCurationsSchemaItemCurationsSourceArtifact | None = None
331
322
  vcs: VcsMatcher | None = None
332
323
  is_metadata_only: bool | None = None
333
324
  is_modified: bool | None = None
325
+ declared_license_mapping: dict[str, Any] = Field(default_factory=dict)
326
+ source_code_origins: list[SourceCodeOrigin] | None = None
327
+ labels: dict[str, str] = Field(default_factory=dict)
334
328
 
335
329
 
336
330
  class CurationsSchemaCurationsSchemaItem(BaseModel):
@@ -341,8 +335,8 @@ class CurationsSchemaCurationsSchemaItem(BaseModel):
341
335
  class CurationsSchema(RootModel[list[CurationsSchemaCurationsSchemaItem]]):
342
336
  root: list[CurationsSchemaCurationsSchemaItem] = Field(
343
337
  ...,
344
- description="The OSS-Review-Toolkit (ORT) provides a possibility to correct metadata and set"
345
- "the concluded license for a specific packages (dependencies) in curation files. A full list of all available"
338
+ description="The OSS-Review-Toolkit (ORT) provides a possibility to correct metadata and set "
339
+ "the concluded license for specific packages (dependencies) in curation files. A full list of all available "
346
340
  "options can be found at https://oss-review-toolkit.org/ort/docs/configuration/package-curations.",
347
341
  title="ORT curations",
348
342
  )
@@ -369,23 +363,44 @@ class OrtRepositoryConfigurationCurations1(BaseModel):
369
363
 
370
364
 
371
365
  class OrtRepositoryConfiguration(BaseModel):
372
- analyzer: OrtAnalyzerConfigurations | None = None
366
+ """
367
+ Represents the configuration for an OSS-Review-Toolkit (ORT) repository.
368
+
369
+ This class defines various configuration options for analyzing, including, excluding,
370
+ resolving, and curating artifacts in a repository. It also provides settings for package
371
+ configurations, license choices, and snippet choices.
372
+
373
+ Usage:
374
+ Instantiate this class to specify repository-level configuration for ORT analysis.
375
+ Each field corresponds to a specific aspect of the repository's configuration.
376
+ """
377
+
378
+ analyzer: OrtAnalyzerConfigurations | None = Field(
379
+ None,
380
+ description="Define Analyzer specific options",
381
+ )
373
382
  includes: OrtRepositoryConfigurationIncludes | None = Field(
374
- None, description="Defines which parts of a repository should be included."
383
+ None,
384
+ description="Defines which parts of a repository should be included.",
375
385
  )
376
386
  excludes: OrtRepositoryConfigurationExcludes | None = Field(
377
- None, description="Defines which parts of a repository should be excluded."
387
+ None,
388
+ description="Defines which parts of a repository should be excluded.",
378
389
  )
379
390
  resolutions: ResolutionsSchema | None = None
380
391
  curations: OrtRepositoryConfigurationCurations | OrtRepositoryConfigurationCurations1 | None = Field(
381
- None, description="Curations for artifacts in a repository."
392
+ None,
393
+ description="Curations for artifacts in a repository.",
382
394
  )
383
395
  package_configurations: list[OrtPackageManagerConfigurations] | None = Field(
384
- None, description="A configuration for a specific package and provenance."
396
+ None,
397
+ description="A configuration for a specific package and provenance.",
385
398
  )
386
399
  license_choices: OrtRepositoryConfigurationLicenseChoices | None = Field(
387
- None, description="A configuration to select a license from a multi-licensed package."
400
+ None,
401
+ description="A configuration to select a license from a multi-licensed package.",
388
402
  )
389
403
  snippet_choices: list[OrtRepositoryConfigurationSnippetChoice] | None = Field(
390
- None, description="A configuration to select a snippet from a package with multiple snippet findings."
404
+ None,
405
+ description="A configuration to select a snippet from a package with multiple snippet findings.",
391
406
  )
@@ -0,0 +1,9 @@
1
+ # SPDX-FileCopyrightText: 2025 Helio Chissini de Castro <heliocastro@gmail.com>
2
+ # SPDX-License-Identifier: MIT
3
+
4
+ from enum import Enum
5
+
6
+
7
+ class SourceCodeOrigin(Enum):
8
+ vcs = "VCS"
9
+ artifact = "ARTIFACT"
@@ -1,21 +0,0 @@
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, RootModel
8
-
9
- from .package_managers import OrtPackageManagers
10
-
11
-
12
- class PackageManagerConfigs(BaseModel):
13
- model_config = ConfigDict(
14
- extra="forbid",
15
- )
16
- must_run_after: list[OrtPackageManagers] | None = Field(None, alias="mustRunAfter")
17
- options: Any | None = None
18
-
19
-
20
- class OrtPackageManagerConfigurations(RootModel[dict[str, PackageManagerConfigs]]):
21
- root: dict[str, PackageManagerConfigs]
File without changes
File without changes