Skip to content

Commit

Permalink
Merge branch 'main' into py313
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Oct 15, 2024
2 parents db4fa3e + 74f4e0a commit d0fa0c2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## [v0.5.2](https://github.com/tlambert03/ome-types/tree/v0.5.2) (2024-09-23)

[Full Changelog](https://github.com/tlambert03/ome-types/compare/v0.5.1.post1...v0.5.2)

**Fixed bugs:**

- fix: swallow exceptions on is\_model [\#262](https://github.com/tlambert03/ome-types/pull/262) ([tlambert03](https://github.com/tlambert03))

**Merged pull requests:**

- ci\(dependabot\): bump CodSpeedHQ/action from 2 to 3 [\#259](https://github.com/tlambert03/ome-types/pull/259) ([dependabot[bot]](https://github.com/apps/dependabot))
- style: add back typos to pre-commit, update [\#257](https://github.com/tlambert03/ome-types/pull/257) ([tlambert03](https://github.com/tlambert03))
- docs: fix plural names in docs [\#256](https://github.com/tlambert03/ome-types/pull/256) ([tlambert03](https://github.com/tlambert03))

## [v0.5.1.post1](https://github.com/tlambert03/ome-types/tree/v0.5.1.post1) (2024-04-01)

[Full Changelog](https://github.com/tlambert03/ome-types/compare/v0.5.1...v0.5.1.post1)

## [v0.5.1](https://github.com/tlambert03/ome-types/tree/v0.5.1) (2024-03-16)

[Full Changelog](https://github.com/tlambert03/ome-types/compare/v0.5.0...v0.5.1)
Expand Down
6 changes: 1 addition & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ classifiers = [
"Programming Language :: Python :: 3.13",
]
dynamic = ["version"]
dependencies = [
"pydantic >=1.10.0",
"pydantic-compat >=0.1.0",
"xsdata >=23.6,<24.4",
]
dependencies = ["pydantic >=1.10.0", "pydantic-compat >=0.1.0", "xsdata >=23.6,<24.4"]

[project.urls]
Source = "https://github.com/tlambert03/ome-types"
Expand Down
14 changes: 7 additions & 7 deletions src/xsdata_pydantic_basemodel/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ def derived_element(self) -> type:
return DerivedElement

def is_model(self, obj: Any) -> bool:
clazz = obj if isinstance(obj, type) else type(obj)
if issubclass(clazz, BaseModel) and clazz != BaseModel:
rebuild = getattr(clazz, "model_rebuild", None)
if callable(rebuild):
rebuild()
return True

with suppress(Exception):
clazz = obj if isinstance(obj, type) else type(obj)
if issubclass(clazz, BaseModel) and clazz != BaseModel:
rebuild = getattr(clazz, "model_rebuild", None)
if callable(rebuild):
rebuild()
return True
return False

#
Expand Down

0 comments on commit d0fa0c2

Please sign in to comment.