Skip to content

Commit

Permalink
fix: fix pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Dec 12, 2023
1 parent e74e7b6 commit b78ab78
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ repos:
exclude: ^tests|^docs

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
rev: v0.1.7
hooks:
- id: ruff
args: [--fix]

- repo: https://github.com/psf/black
rev: 23.11.0
rev: 23.12.0
hooks:
- id: black
exclude: ^docs
Expand Down
2 changes: 1 addition & 1 deletion src/ome_types/_pydantic_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def field_regex(obj: type[BaseModel], field_name: str) -> str | None:
if field_info.json_schema_extra and isinstance(
field_info.json_schema_extra, dict
):
return field_info.json_schema_extra.get("pattern")
return field_info.json_schema_extra.get("pattern") # type: ignore
return None

def get_default(f: FieldInfo) -> Any:
Expand Down
4 changes: 2 additions & 2 deletions src/ome_types/model/_shape_union.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class ShapeUnion(OMEType, RootModel, UserSequence[ShapeType]): # type: ignore[m
default_factory=list,
json_schema_extra={
"type": "Elements",
"choices": tuple(
"choices": tuple( # type: ignore[dict-item]
{"name": kind.title(), "type": cls} for kind, cls in _KINDS.items()
),
},
Expand Down Expand Up @@ -117,7 +117,7 @@ class ShapeUnion(OMEType, UserSequence[ShapeType]): # type: ignore
# for some reason that messes up xsdata data binding
__root__: List[object] = Field(
default_factory=list,
metadata={
metadata={ # type: ignore[call-arg]
"type": "Elements",
"choices": tuple(
{"name": kind.title(), "type": cls} for kind, cls in _KINDS.items()
Expand Down
4 changes: 2 additions & 2 deletions src/ome_types/model/_structured_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class StructuredAnnotationList(OMEType, RootModel, UserSequence[Annotation]): #
default_factory=list,
json_schema_extra={
"type": "Elements",
"choices": tuple(
"choices": tuple( # type: ignore[dict-item]
{"name": cls.__name__, "type": cls} for cls in AnnotationTypes
),
},
Expand Down Expand Up @@ -124,7 +124,7 @@ class StructuredAnnotationList(OMEType, UserSequence[Annotation]): # type: igno
# for some reason that messes up xsdata data binding
__root__: List[object] = Field(
default_factory=list,
metadata={
metadata={ # type: ignore[call-arg]
"type": "Elements",
"choices": tuple(
{"name": cls.__name__, "type": cls} for cls in AnnotationTypes
Expand Down
6 changes: 4 additions & 2 deletions src/xsdata_pydantic_basemodel/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ class AnyElement(PydanticCompatMixin, BaseModel):
text: Optional[str] = Field(default=None)
tail: Optional[str] = Field(default=None)
children: List["AnyElement"] = Field(
default_factory=list, metadata={"type": XmlType.WILDCARD}
default_factory=list,
metadata={"type": XmlType.WILDCARD}, # type: ignore [call-arg]
)
attributes: Dict[str, str] = Field(
default_factory=dict, metadata={"type": XmlType.ATTRIBUTES}
default_factory=dict,
metadata={"type": XmlType.ATTRIBUTES}, # type: ignore [call-arg]
)

model_config: ClassVar["ConfigDict"] = {"arbitrary_types_allowed": True}
Expand Down

0 comments on commit b78ab78

Please sign in to comment.