Skip to content

Commit 1354666

Browse files
authored
Merge pull request #65 from hubmapconsortium/release-please--branches--main--changes--next
release: 2.0.0-alpha.40
2 parents 2ecf851 + 7851be9 commit 1354666

File tree

6 files changed

+17
-52
lines changed

6 files changed

+17
-52
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "2.0.0-alpha.39"
2+
".": "2.0.0-alpha.40"
33
}

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 2.0.0-alpha.40 (2025-09-06)
4+
5+
Full Changelog: [v2.0.0-alpha.39...v2.0.0-alpha.40](https://github.com/hubmapconsortium/entity-python-sdk/compare/v2.0.0-alpha.39...v2.0.0-alpha.40)
6+
7+
### Chores
8+
9+
* **tests:** simplify `get_platform` test ([7ed6bcb](https://github.com/hubmapconsortium/entity-python-sdk/commit/7ed6bcb520fbda42c962706e7673b858eb74d337))
10+
311
## 2.0.0-alpha.39 (2025-09-05)
412

513
Full Changelog: [v2.0.0-alpha.38...v2.0.0-alpha.39](https://github.com/hubmapconsortium/entity-python-sdk/compare/v2.0.0-alpha.38...v2.0.0-alpha.39)

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "hubmap_entity_sdk"
3-
version = "2.0.0-alpha.39"
3+
version = "2.0.0-alpha.40"
44
description = "The official Python library for the hubmap-entity-sdk API"
55
dynamic = ["readme"]
66
license = "MIT"
@@ -56,7 +56,6 @@ dev-dependencies = [
5656
"dirty-equals>=0.6.0",
5757
"importlib-metadata>=6.7.0",
5858
"rich>=13.7.1",
59-
"nest_asyncio==1.6.0",
6059
"pytest-xdist>=3.6.1",
6160
]
6261

requirements-dev.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ multidict==6.4.4
7575
mypy==1.14.1
7676
mypy-extensions==1.0.0
7777
# via mypy
78-
nest-asyncio==1.6.0
7978
nodeenv==1.8.0
8079
# via pyright
8180
nox==2023.4.22

src/hubmap_entity_sdk/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "hubmap_entity_sdk"
4-
__version__ = "2.0.0-alpha.39" # x-release-please-version
4+
__version__ = "2.0.0-alpha.40" # x-release-please-version

tests/test_client.py

Lines changed: 6 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@
66
import os
77
import sys
88
import json
9-
import time
109
import asyncio
1110
import inspect
12-
import subprocess
1311
import tracemalloc
1412
from typing import Any, Union, cast
15-
from textwrap import dedent
1613
from unittest import mock
1714
from typing_extensions import Literal
1815

@@ -23,14 +20,17 @@
2320

2421
from hubmap_entity_sdk import HubmapEntitySDK, AsyncHubmapEntitySDK, APIResponseValidationError
2522
from hubmap_entity_sdk._types import Omit
23+
from hubmap_entity_sdk._utils import asyncify
2624
from hubmap_entity_sdk._models import BaseModel, FinalRequestOptions
2725
from hubmap_entity_sdk._exceptions import APIStatusError, APITimeoutError, APIResponseValidationError
2826
from hubmap_entity_sdk._base_client import (
2927
DEFAULT_TIMEOUT,
3028
HTTPX_DEFAULT_TIMEOUT,
3129
BaseClient,
30+
OtherPlatform,
3231
DefaultHttpxClient,
3332
DefaultAsyncHttpxClient,
33+
get_platform,
3434
make_request_options,
3535
)
3636

@@ -1681,50 +1681,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
16811681

16821682
assert response.http_request.headers.get("x-stainless-retry-count") == "42"
16831683

1684-
def test_get_platform(self) -> None:
1685-
# A previous implementation of asyncify could leave threads unterminated when
1686-
# used with nest_asyncio.
1687-
#
1688-
# Since nest_asyncio.apply() is global and cannot be un-applied, this
1689-
# test is run in a separate process to avoid affecting other tests.
1690-
test_code = dedent("""
1691-
import asyncio
1692-
import nest_asyncio
1693-
import threading
1694-
1695-
from hubmap_entity_sdk._utils import asyncify
1696-
from hubmap_entity_sdk._base_client import get_platform
1697-
1698-
async def test_main() -> None:
1699-
result = await asyncify(get_platform)()
1700-
print(result)
1701-
for thread in threading.enumerate():
1702-
print(thread.name)
1703-
1704-
nest_asyncio.apply()
1705-
asyncio.run(test_main())
1706-
""")
1707-
with subprocess.Popen(
1708-
[sys.executable, "-c", test_code],
1709-
text=True,
1710-
) as process:
1711-
timeout = 10 # seconds
1712-
1713-
start_time = time.monotonic()
1714-
while True:
1715-
return_code = process.poll()
1716-
if return_code is not None:
1717-
if return_code != 0:
1718-
raise AssertionError("calling get_platform using asyncify resulted in a non-zero exit code")
1719-
1720-
# success
1721-
break
1722-
1723-
if time.monotonic() - start_time > timeout:
1724-
process.kill()
1725-
raise AssertionError("calling get_platform using asyncify resulted in a hung process")
1726-
1727-
time.sleep(0.1)
1684+
async def test_get_platform(self) -> None:
1685+
platform = await asyncify(get_platform)()
1686+
assert isinstance(platform, (str, OtherPlatform))
17281687

17291688
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
17301689
# Test that the proxy environment variables are set correctly

0 commit comments

Comments
 (0)