hubmap-search-sdk 1.0.0a12__tar.gz → 1.0.0a13__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. hubmap_search_sdk-1.0.0a13/.release-please-manifest.json +3 -0
  2. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/CHANGELOG.md +13 -0
  3. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/CONTRIBUTING.md +1 -2
  4. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/PKG-INFO +1 -1
  5. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/pyproject.toml +1 -1
  6. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/_base_client.py +6 -0
  7. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/_models.py +2 -0
  8. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/_types.py +2 -0
  9. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/_version.py +1 -1
  10. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/test_client.py +54 -0
  11. hubmap_search_sdk-1.0.0a12/.release-please-manifest.json +0 -3
  12. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/.gitignore +0 -0
  13. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/LICENSE +0 -0
  14. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/README.md +0 -0
  15. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/SECURITY.md +0 -0
  16. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/api.md +0 -0
  17. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/bin/check-release-environment +0 -0
  18. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/bin/publish-pypi +0 -0
  19. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/examples/.keep +0 -0
  20. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/mypy.ini +0 -0
  21. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/noxfile.py +0 -0
  22. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/release-please-config.json +0 -0
  23. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/requirements-dev.lock +0 -0
  24. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/requirements.lock +0 -0
  25. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/__init__.py +0 -0
  26. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/_client.py +0 -0
  27. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/_compat.py +0 -0
  28. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/_constants.py +0 -0
  29. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/_exceptions.py +0 -0
  30. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/_files.py +0 -0
  31. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/_qs.py +0 -0
  32. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/_resource.py +0 -0
  33. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/_response.py +0 -0
  34. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/_streaming.py +0 -0
  35. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/_utils/__init__.py +0 -0
  36. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/_utils/_logs.py +0 -0
  37. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/_utils/_proxy.py +0 -0
  38. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/_utils/_reflection.py +0 -0
  39. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/_utils/_resources_proxy.py +0 -0
  40. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/_utils/_streams.py +0 -0
  41. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/_utils/_sync.py +0 -0
  42. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/_utils/_transform.py +0 -0
  43. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/_utils/_typing.py +0 -0
  44. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/_utils/_utils.py +0 -0
  45. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/lib/.keep +0 -0
  46. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/py.typed +0 -0
  47. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/resources/__init__.py +0 -0
  48. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/resources/add.py +0 -0
  49. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/resources/clear_docs.py +0 -0
  50. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/resources/indices.py +0 -0
  51. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/resources/mapping.py +0 -0
  52. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/resources/mget.py +0 -0
  53. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/resources/param_search.py +0 -0
  54. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/resources/reindex.py +0 -0
  55. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/resources/scroll_search.py +0 -0
  56. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/resources/search.py +0 -0
  57. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/resources/update.py +0 -0
  58. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/types/__init__.py +0 -0
  59. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/types/add_create_document_params.py +0 -0
  60. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/types/add_create_document_with_index_params.py +0 -0
  61. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/types/add_update_document_with_scope_params.py +0 -0
  62. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/types/index_list_response.py +0 -0
  63. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/types/mget_retrieve_multiple_by_index_params.py +0 -0
  64. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/types/mget_retrieve_multiple_params.py +0 -0
  65. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/types/param_search_execute_params.py +0 -0
  66. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/types/scroll_search_create_params.py +0 -0
  67. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/types/search_execute_index_query_params.py +0 -0
  68. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/types/search_execute_query_params.py +0 -0
  69. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/types/update_update_document_at_index_params.py +0 -0
  70. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/types/update_update_document_params.py +0 -0
  71. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/src/hubmap_search_sdk/types/update_update_document_with_scope_params.py +0 -0
  72. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/__init__.py +0 -0
  73. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/api_resources/__init__.py +0 -0
  74. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/api_resources/test_add.py +0 -0
  75. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/api_resources/test_clear_docs.py +0 -0
  76. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/api_resources/test_indices.py +0 -0
  77. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/api_resources/test_mapping.py +0 -0
  78. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/api_resources/test_mget.py +0 -0
  79. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/api_resources/test_param_search.py +0 -0
  80. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/api_resources/test_reindex.py +0 -0
  81. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/api_resources/test_scroll_search.py +0 -0
  82. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/api_resources/test_search.py +0 -0
  83. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/api_resources/test_update.py +0 -0
  84. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/conftest.py +0 -0
  85. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/sample_file.txt +0 -0
  86. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/test_deepcopy.py +0 -0
  87. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/test_extract_files.py +0 -0
  88. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/test_files.py +0 -0
  89. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/test_models.py +0 -0
  90. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/test_qs.py +0 -0
  91. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/test_required_args.py +0 -0
  92. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/test_response.py +0 -0
  93. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/test_streaming.py +0 -0
  94. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/test_transform.py +0 -0
  95. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/test_utils/test_proxy.py +0 -0
  96. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/test_utils/test_typing.py +0 -0
  97. {hubmap_search_sdk-1.0.0a12 → hubmap_search_sdk-1.0.0a13}/tests/utils.py +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "1.0.0-alpha.13"
3
+ }
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.0-alpha.13 (2025-06-03)
4
+
5
+ Full Changelog: [v1.0.0-alpha.12...v1.0.0-alpha.13](https://github.com/hubmapconsortium/search-python-sdk/compare/v1.0.0-alpha.12...v1.0.0-alpha.13)
6
+
7
+ ### Features
8
+
9
+ * **client:** add follow_redirects request option ([55b10c1](https://github.com/hubmapconsortium/search-python-sdk/commit/55b10c18cfea334e5ea9558f70ded70c2b21e34c))
10
+
11
+
12
+ ### Chores
13
+
14
+ * **docs:** remove reference to rye shell ([ef26230](https://github.com/hubmapconsortium/search-python-sdk/commit/ef262304d809361ee6d56932bdb9328157e8aef6))
15
+
3
16
  ## 1.0.0-alpha.12 (2025-05-28)
4
17
 
5
18
  Full Changelog: [v1.0.0-alpha.11...v1.0.0-alpha.12](https://github.com/hubmapconsortium/search-python-sdk/compare/v1.0.0-alpha.11...v1.0.0-alpha.12)
@@ -17,8 +17,7 @@ $ rye sync --all-features
17
17
  You can then run scripts using `rye run python script.py` or by activating the virtual environment:
18
18
 
19
19
  ```sh
20
- $ rye shell
21
- # or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work
20
+ # Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work
22
21
  $ source .venv/bin/activate
23
22
 
24
23
  # now you can omit the `rye run` prefix
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: hubmap_search_sdk
3
- Version: 1.0.0a12
3
+ Version: 1.0.0a13
4
4
  Summary: The official Python library for the hubmap-search-sdk API
5
5
  Project-URL: Homepage, https://github.com/hubmapconsortium/search-python-sdk
6
6
  Project-URL: Repository, https://github.com/hubmapconsortium/search-python-sdk
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "hubmap_search_sdk"
3
- version = "1.0.0-alpha.12"
3
+ version = "1.0.0-alpha.13"
4
4
  description = "The official Python library for the hubmap-search-sdk API"
5
5
  dynamic = ["readme"]
6
6
  license = "MIT"
@@ -963,6 +963,9 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
963
963
  if self.custom_auth is not None:
964
964
  kwargs["auth"] = self.custom_auth
965
965
 
966
+ if options.follow_redirects is not None:
967
+ kwargs["follow_redirects"] = options.follow_redirects
968
+
966
969
  log.debug("Sending HTTP Request: %s %s", request.method, request.url)
967
970
 
968
971
  response = None
@@ -1472,6 +1475,9 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1472
1475
  if self.custom_auth is not None:
1473
1476
  kwargs["auth"] = self.custom_auth
1474
1477
 
1478
+ if options.follow_redirects is not None:
1479
+ kwargs["follow_redirects"] = options.follow_redirects
1480
+
1475
1481
  log.debug("Sending HTTP Request: %s %s", request.method, request.url)
1476
1482
 
1477
1483
  response = None
@@ -737,6 +737,7 @@ class FinalRequestOptionsInput(TypedDict, total=False):
737
737
  idempotency_key: str
738
738
  json_data: Body
739
739
  extra_json: AnyMapping
740
+ follow_redirects: bool
740
741
 
741
742
 
742
743
  @final
@@ -750,6 +751,7 @@ class FinalRequestOptions(pydantic.BaseModel):
750
751
  files: Union[HttpxRequestFiles, None] = None
751
752
  idempotency_key: Union[str, None] = None
752
753
  post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven()
754
+ follow_redirects: Union[bool, None] = None
753
755
 
754
756
  # It should be noted that we cannot use `json` here as that would override
755
757
  # a BaseModel method in an incompatible fashion.
@@ -100,6 +100,7 @@ class RequestOptions(TypedDict, total=False):
100
100
  params: Query
101
101
  extra_json: AnyMapping
102
102
  idempotency_key: str
103
+ follow_redirects: bool
103
104
 
104
105
 
105
106
  # Sentinel class used until PEP 0661 is accepted
@@ -215,3 +216,4 @@ class _GenericAlias(Protocol):
215
216
 
216
217
  class HttpxSendArgs(TypedDict, total=False):
217
218
  auth: httpx.Auth
219
+ follow_redirects: bool
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "hubmap_search_sdk"
4
- __version__ = "1.0.0-alpha.12" # x-release-please-version
4
+ __version__ = "1.0.0-alpha.13" # x-release-please-version
@@ -833,6 +833,33 @@ class TestHubmapSearchSDK:
833
833
 
834
834
  assert response.http_request.headers.get("x-stainless-retry-count") == "42"
835
835
 
836
+ @pytest.mark.respx(base_url=base_url)
837
+ def test_follow_redirects(self, respx_mock: MockRouter) -> None:
838
+ # Test that the default follow_redirects=True allows following redirects
839
+ respx_mock.post("/redirect").mock(
840
+ return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"})
841
+ )
842
+ respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"}))
843
+
844
+ response = self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response)
845
+ assert response.status_code == 200
846
+ assert response.json() == {"status": "ok"}
847
+
848
+ @pytest.mark.respx(base_url=base_url)
849
+ def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None:
850
+ # Test that follow_redirects=False prevents following redirects
851
+ respx_mock.post("/redirect").mock(
852
+ return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"})
853
+ )
854
+
855
+ with pytest.raises(APIStatusError) as exc_info:
856
+ self.client.post(
857
+ "/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response
858
+ )
859
+
860
+ assert exc_info.value.response.status_code == 302
861
+ assert exc_info.value.response.headers["Location"] == f"{base_url}/redirected"
862
+
836
863
 
837
864
  class TestAsyncHubmapSearchSDK:
838
865
  client = AsyncHubmapSearchSDK(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True)
@@ -1669,3 +1696,30 @@ class TestAsyncHubmapSearchSDK:
1669
1696
  raise AssertionError("calling get_platform using asyncify resulted in a hung process")
1670
1697
 
1671
1698
  time.sleep(0.1)
1699
+
1700
+ @pytest.mark.respx(base_url=base_url)
1701
+ async def test_follow_redirects(self, respx_mock: MockRouter) -> None:
1702
+ # Test that the default follow_redirects=True allows following redirects
1703
+ respx_mock.post("/redirect").mock(
1704
+ return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"})
1705
+ )
1706
+ respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"}))
1707
+
1708
+ response = await self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response)
1709
+ assert response.status_code == 200
1710
+ assert response.json() == {"status": "ok"}
1711
+
1712
+ @pytest.mark.respx(base_url=base_url)
1713
+ async def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None:
1714
+ # Test that follow_redirects=False prevents following redirects
1715
+ respx_mock.post("/redirect").mock(
1716
+ return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"})
1717
+ )
1718
+
1719
+ with pytest.raises(APIStatusError) as exc_info:
1720
+ await self.client.post(
1721
+ "/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response
1722
+ )
1723
+
1724
+ assert exc_info.value.response.status_code == 302
1725
+ assert exc_info.value.response.headers["Location"] == f"{base_url}/redirected"
@@ -1,3 +0,0 @@
1
- {
2
- ".": "1.0.0-alpha.12"
3
- }