diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 95ab733..521804d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.0.0-alpha.9" + ".": "2.0.0-alpha.10" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ae1c53..54e1bbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 2.0.0-alpha.10 (2025-05-09) + +Full Changelog: [v2.0.0-alpha.9...v2.0.0-alpha.10](https://github.com/hubmapconsortium/entity-python-sdk/compare/v2.0.0-alpha.9...v2.0.0-alpha.10) + +### Chores + +* **internal:** avoid errors for isinstance checks on proxies ([ea5c6d6](https://github.com/hubmapconsortium/entity-python-sdk/commit/ea5c6d68a5c19635941e23d9e4b9d2baf94c69d5)) + ## 2.0.0-alpha.9 (2025-04-24) Full Changelog: [v2.0.0-alpha.8...v2.0.0-alpha.9](https://github.com/hubmapconsortium/entity-python-sdk/compare/v2.0.0-alpha.8...v2.0.0-alpha.9) diff --git a/pyproject.toml b/pyproject.toml index ff51352..d74ca40 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "hubmap_entity_sdk" -version = "2.0.0-alpha.9" +version = "2.0.0-alpha.10" description = "The official Python library for the hubmap-entity-sdk API" dynamic = ["readme"] license = "MIT" diff --git a/src/hubmap_entity_sdk/_utils/_proxy.py b/src/hubmap_entity_sdk/_utils/_proxy.py index ffd883e..0f239a3 100644 --- a/src/hubmap_entity_sdk/_utils/_proxy.py +++ b/src/hubmap_entity_sdk/_utils/_proxy.py @@ -46,7 +46,10 @@ def __dir__(self) -> Iterable[str]: @property # type: ignore @override def __class__(self) -> type: # pyright: ignore - proxied = self.__get_proxied__() + try: + proxied = self.__get_proxied__() + except Exception: + return type(self) if issubclass(type(proxied), LazyProxy): return type(proxied) return proxied.__class__ diff --git a/src/hubmap_entity_sdk/_version.py b/src/hubmap_entity_sdk/_version.py index 7cba17d..b660e16 100644 --- a/src/hubmap_entity_sdk/_version.py +++ b/src/hubmap_entity_sdk/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "hubmap_entity_sdk" -__version__ = "2.0.0-alpha.9" # x-release-please-version +__version__ = "2.0.0-alpha.10" # x-release-please-version diff --git a/tests/test_utils/test_proxy.py b/tests/test_utils/test_proxy.py index 810060e..9846ba2 100644 --- a/tests/test_utils/test_proxy.py +++ b/tests/test_utils/test_proxy.py @@ -21,3 +21,14 @@ def test_recursive_proxy() -> None: assert dir(proxy) == [] assert type(proxy).__name__ == "RecursiveLazyProxy" assert type(operator.attrgetter("name.foo.bar.baz")(proxy)).__name__ == "RecursiveLazyProxy" + + +def test_isinstance_does_not_error() -> None: + class AlwaysErrorProxy(LazyProxy[Any]): + @override + def __load__(self) -> Any: + raise RuntimeError("Mocking missing dependency") + + proxy = AlwaysErrorProxy() + assert not isinstance(proxy, dict) + assert isinstance(proxy, LazyProxy)