Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ repos:
- '--fix=lf'

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.15.1'
rev: 'v0.15.4'
hooks:
- id: ruff
args: [--fix]
- id: ruff-format

- repo: https://github.com/compilerla/conventional-pre-commit
rev: 'v4.3.0'
rev: 'v4.4.0'
hooks:
- id: conventional-pre-commit
stages: [commit-msg]

- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.10.3
rev: 0.10.7
hooks:
- id: uv-lock

Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "uv_build"

[project]
name = "python-ort"
version = "0.6.3"
version = "0.6.4"
description = "A Python Ort model serialization library"
readme = "README.md"
license = "MIT"
Expand Down Expand Up @@ -37,9 +37,9 @@ module-root = "src"
dev = [
"datamodel-code-generator[http]>=0.54.0",
"pytest>=9.0.2",
"rich>=14.3.2",
"ruff>=0.15.1",
"ty>=0.0.17",
"rich>=14.3.3",
"ruff>=0.15.4",
"ty>=0.0.20",
"types-pyyaml>=6.0.12.20250915",
]

Expand Down
5 changes: 3 additions & 2 deletions src/ort/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ class Project(BaseModel):
description="The description of project.",
)
homepage_url: str = Field(..., description="The URL to the project's homepage.")
scope_dependencies: set[Scope] | None = Field(
None,
scope_dependencies: set[Scope] = Field(
default_factory=set,
Comment on lines +62 to +63
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scope_dependencies is typed as set[Scope], but Scope is a mutable Pydantic BaseModel (not frozen) and does not implement __hash__, so parsing a non-empty scopes list will raise TypeError: unhashable type: 'Scope' when building the set. Consider switching this field to a list (to match YAML/JSON lists), or make Scope hashable (e.g., frozen + stable __hash__/__eq__) if set semantics are required.

Suggested change
scope_dependencies: set[Scope] = Field(
default_factory=set,
scope_dependencies: list[Scope] = Field(
default_factory=list,

Copilot uses AI. Check for mistakes.
alias="scopes",
description="Holds information about the scopes and their dependencies of this project if no DependencyGraph"
"is available. NOTE: Do not use this property to access scope information. Use scopes instead, which is"
"correctly initialized in all cases.",
Comment on lines 66 to 67
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field description says "Use scopes instead", but this model does not expose a scopes attribute/property—only scope_dependencies. With the new alias, scopes exists only as an input key, not a Python attribute, so this is misleading. Consider updating the wording to reference scope_dependencies, or renaming the field to scopes (keeping an alias for backwards compatibility) so the documentation matches the API.

Suggested change
"is available. NOTE: Do not use this property to access scope information. Use scopes instead, which is"
"correctly initialized in all cases.",
"is available. NOTE: In Python, use the 'scope_dependencies' attribute to access scope information; the"
"input alias 'scopes' is provided for compatibility.",

Copilot uses AI. Check for mistakes.
Expand Down
Loading