aws_sdk_sagemaker_runtime_http2 0.10.0__tar.gz → 0.11.0__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.
- aws_sdk_sagemaker_runtime_http2-0.11.0/.changes/0.11.0.json +16 -0
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/CHANGELOG.md +9 -0
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/PKG-INFO +5 -3
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/pyproject.toml +8 -3
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/scripts/docs/generate_doc_stubs.py +38 -4
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/src/aws_sdk_sagemaker_runtime_http2/__init__.py +1 -1
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/src/aws_sdk_sagemaker_runtime_http2/client.py +27 -19
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/src/aws_sdk_sagemaker_runtime_http2/config.py +2 -2
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/.changes/0.1.0.json +0 -0
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/.changes/0.10.0.json +0 -0
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/.changes/0.3.0.json +0 -0
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/.changes/0.4.0.json +0 -0
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/.changes/0.5.0.json +0 -0
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/.changes/0.6.0.json +0 -0
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/.changes/0.7.0.json +0 -0
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/.changes/0.8.0.json +0 -0
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/.changes/0.9.0.json +0 -0
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/.gitignore +0 -0
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/LICENSE +0 -0
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/Makefile +0 -0
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/NOTICE +0 -0
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/README.md +0 -0
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/docs/README.md +0 -0
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/docs/index.md +0 -0
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/docs/stylesheets/extra.css +0 -0
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/src/aws_sdk_sagemaker_runtime_http2/_private/__init__.py +0 -0
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/src/aws_sdk_sagemaker_runtime_http2/_private/schemas.py +0 -0
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/src/aws_sdk_sagemaker_runtime_http2/auth.py +0 -0
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/src/aws_sdk_sagemaker_runtime_http2/models.py +0 -0
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/src/aws_sdk_sagemaker_runtime_http2/user_agent.py +0 -0
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/tests/__init__.py +0 -0
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/tests/test_restjson_protocol.py +0 -0
- {aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/zensical.toml +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"changes": [
|
|
3
|
+
{
|
|
4
|
+
"type": "enhancement",
|
|
5
|
+
"description": "Re-generated with smithy-python 0.5.0"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"type": "dependency",
|
|
9
|
+
"description": "Bump `smithy-aws-core` from `~=0.10.0` to `~=0.11.0`."
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"type": "dependency",
|
|
13
|
+
"description": "Bump `smithy-http` from `~=0.4.0` to `~=0.5.0`."
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
{aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/CHANGELOG.md
RENAMED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v0.11.0
|
|
4
|
+
|
|
5
|
+
### Enhancements
|
|
6
|
+
* Re-generated with smithy-python 0.5.0
|
|
7
|
+
|
|
8
|
+
### Dependencies
|
|
9
|
+
* Bump `smithy-aws-core` from `~=0.10.0` to `~=0.11.0`.
|
|
10
|
+
* Bump `smithy-http` from `~=0.4.0` to `~=0.5.0`.
|
|
11
|
+
|
|
3
12
|
## v0.10.0
|
|
4
13
|
|
|
5
14
|
### Dependencies
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: aws_sdk_sagemaker_runtime_http2
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.11.0
|
|
4
4
|
Summary: aws_sdk_sagemaker_runtime_http2 client
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
License-File: LICENSE
|
|
@@ -18,9 +18,11 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.13
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.14
|
|
20
20
|
Requires-Python: >=3.12
|
|
21
|
-
Requires-Dist: smithy-aws-core[eventstream,json]~=0.
|
|
21
|
+
Requires-Dist: smithy-aws-core[eventstream,json]~=0.11.0
|
|
22
22
|
Requires-Dist: smithy-core~=0.8.0
|
|
23
|
-
Requires-Dist: smithy-http[
|
|
23
|
+
Requires-Dist: smithy-http[aiohttp]~=0.5.0
|
|
24
|
+
Provides-Extra: awscrt
|
|
25
|
+
Requires-Dist: smithy-http[awscrt]~=0.5.0; extra == 'awscrt'
|
|
24
26
|
Description-Content-Type: text/markdown
|
|
25
27
|
|
|
26
28
|
## Amazon SageMaker Runtime HTTP2 Client
|
{aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/pyproject.toml
RENAMED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[project]
|
|
4
4
|
name = "aws_sdk_sagemaker_runtime_http2"
|
|
5
|
-
version = "0.
|
|
5
|
+
version = "0.11.0"
|
|
6
6
|
description = "aws_sdk_sagemaker_runtime_http2 client"
|
|
7
7
|
readme = "README.md"
|
|
8
8
|
requires-python = ">=3.12"
|
|
@@ -23,9 +23,14 @@ classifiers = [
|
|
|
23
23
|
]
|
|
24
24
|
|
|
25
25
|
dependencies = [
|
|
26
|
-
"smithy_aws_core[eventstream, json]~=0.
|
|
26
|
+
"smithy_aws_core[eventstream, json]~=0.11.0",
|
|
27
27
|
"smithy_core~=0.8.0",
|
|
28
|
-
"smithy_http[
|
|
28
|
+
"smithy_http[aiohttp]~=0.5.0"
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
[project.optional-dependencies]
|
|
32
|
+
awscrt = [
|
|
33
|
+
"smithy_http[awscrt]~=0.5.0"
|
|
29
34
|
]
|
|
30
35
|
|
|
31
36
|
[dependency-groups]
|
|
@@ -40,6 +40,7 @@ logger = logging.getLogger("generate_doc_stubs")
|
|
|
40
40
|
|
|
41
41
|
ENUM_BASE_CLASSES = ("StrEnum", "IntEnum")
|
|
42
42
|
ERROR_BASE_CLASSES = ("ServiceError", "ModeledError")
|
|
43
|
+
CLIENT_METHOD_NAMES = ("close",)
|
|
43
44
|
|
|
44
45
|
|
|
45
46
|
class StreamType(Enum):
|
|
@@ -90,6 +91,14 @@ class OperationInfo:
|
|
|
90
91
|
event_output_type: str | None # For output/duplex streams
|
|
91
92
|
|
|
92
93
|
|
|
94
|
+
@dataclass
|
|
95
|
+
class ClientMethodInfo:
|
|
96
|
+
"""Information about a non-operation client method."""
|
|
97
|
+
|
|
98
|
+
name: str
|
|
99
|
+
module_path: str
|
|
100
|
+
|
|
101
|
+
|
|
93
102
|
@dataclass
|
|
94
103
|
class ModelsInfo:
|
|
95
104
|
"""Information about all modeled types."""
|
|
@@ -109,6 +118,7 @@ class ClientInfo:
|
|
|
109
118
|
package_name: str # e.g., "aws_sdk_bedrock_runtime"
|
|
110
119
|
config: TypeInfo
|
|
111
120
|
plugin: TypeInfo
|
|
121
|
+
client_methods: list[ClientMethodInfo]
|
|
112
122
|
operations: list[OperationInfo]
|
|
113
123
|
models: ModelsInfo
|
|
114
124
|
|
|
@@ -202,11 +212,13 @@ class DocStubGenerator:
|
|
|
202
212
|
config = TypeInfo(name=config_class.name, module_path=config_class.path)
|
|
203
213
|
plugin = TypeInfo(name=plugin_alias.name, module_path=plugin_alias.path)
|
|
204
214
|
|
|
215
|
+
client_methods = self._extract_client_methods(client_class)
|
|
205
216
|
operations = self._extract_operations(client_class)
|
|
206
217
|
models = self._extract_models(models_module, operations)
|
|
207
218
|
|
|
208
219
|
logger.info(
|
|
209
|
-
f"Analyzed {client_class.name}: {len(
|
|
220
|
+
f"Analyzed {client_class.name}: {len(client_methods)} client methods, "
|
|
221
|
+
f"{len(operations)} operations, "
|
|
210
222
|
f"{len(models.structures)} structures, {len(models.errors)} errors, "
|
|
211
223
|
f"{len(models.unions)} unions, {len(models.enums)} enums"
|
|
212
224
|
)
|
|
@@ -217,6 +229,7 @@ class DocStubGenerator:
|
|
|
217
229
|
package_name=package_name,
|
|
218
230
|
config=config,
|
|
219
231
|
plugin=plugin,
|
|
232
|
+
client_methods=client_methods,
|
|
220
233
|
operations=operations,
|
|
221
234
|
models=models,
|
|
222
235
|
)
|
|
@@ -236,11 +249,24 @@ class DocStubGenerator:
|
|
|
236
249
|
"""Extract operation information from client class."""
|
|
237
250
|
operations = []
|
|
238
251
|
for op in client_class.functions.values():
|
|
239
|
-
if
|
|
252
|
+
if (
|
|
253
|
+
op.is_private
|
|
254
|
+
or op.is_init_method
|
|
255
|
+
or op.is_special
|
|
256
|
+
or op.name in CLIENT_METHOD_NAMES
|
|
257
|
+
):
|
|
240
258
|
continue
|
|
241
259
|
operations.append(self._analyze_operation(op))
|
|
242
260
|
return operations
|
|
243
261
|
|
|
262
|
+
def _extract_client_methods(self, client_class: Class) -> list[ClientMethodInfo]:
|
|
263
|
+
"""Extract public client methods that are not service operations."""
|
|
264
|
+
return [
|
|
265
|
+
ClientMethodInfo(name=method.name, module_path=method.path)
|
|
266
|
+
for method in client_class.functions.values()
|
|
267
|
+
if not method.is_private and method.name in CLIENT_METHOD_NAMES
|
|
268
|
+
]
|
|
269
|
+
|
|
244
270
|
def _analyze_operation(self, operation: Function) -> OperationInfo:
|
|
245
271
|
"""Analyze an operation method to extract information."""
|
|
246
272
|
stream_type = None
|
|
@@ -271,7 +297,8 @@ class DocStubGenerator:
|
|
|
271
297
|
event_output_type = stream_args[idx].canonical_name
|
|
272
298
|
|
|
273
299
|
output_info = TypeInfo(
|
|
274
|
-
name=stream_args[-1].canonical_name,
|
|
300
|
+
name=stream_args[-1].canonical_name,
|
|
301
|
+
module_path=stream_args[-1].canonical_path,
|
|
275
302
|
)
|
|
276
303
|
else:
|
|
277
304
|
output_info = TypeInfo(name=output_type, module_path=returns.canonical_path)
|
|
@@ -434,6 +461,9 @@ class DocStubGenerator:
|
|
|
434
461
|
"",
|
|
435
462
|
]
|
|
436
463
|
|
|
464
|
+
for method in sorted(client_info.client_methods, key=lambda x: x.name):
|
|
465
|
+
lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""])
|
|
466
|
+
|
|
437
467
|
# Operations section
|
|
438
468
|
if client_info.operations:
|
|
439
469
|
lines.append("## Operations")
|
|
@@ -639,7 +669,11 @@ def main() -> int:
|
|
|
639
669
|
description="Generate API documentation stubs for AWS SDK Python client."
|
|
640
670
|
)
|
|
641
671
|
parser.add_argument(
|
|
642
|
-
"-c",
|
|
672
|
+
"-c",
|
|
673
|
+
"--client-dir",
|
|
674
|
+
type=Path,
|
|
675
|
+
required=True,
|
|
676
|
+
help="Path to the client source package",
|
|
643
677
|
)
|
|
644
678
|
parser.add_argument(
|
|
645
679
|
"-o",
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
import asyncio
|
|
4
4
|
from copy import deepcopy
|
|
5
5
|
import logging
|
|
6
|
-
from typing import Any,
|
|
7
|
-
import warnings
|
|
6
|
+
from typing import Any, Self, cast
|
|
8
7
|
|
|
9
8
|
from smithy_aws_core.config import ConfigSource
|
|
10
9
|
from smithy_aws_core.identity import AWSCredentialsIdentity
|
|
@@ -12,6 +11,7 @@ from smithy_aws_core.identity.chain import IdentityChain
|
|
|
12
11
|
from smithy_core.aio.client import ClientCall, RequestPipeline
|
|
13
12
|
from smithy_core.aio.eventstream import DuplexEventStream
|
|
14
13
|
from smithy_core.aio.retries import RetryStrategyResolver
|
|
14
|
+
from smithy_core.aio.utils import close
|
|
15
15
|
from smithy_core.exceptions import ExpectationNotMetError
|
|
16
16
|
from smithy_core.interceptors import InterceptorChain
|
|
17
17
|
from smithy_core.types import TypedProperties
|
|
@@ -56,6 +56,7 @@ class AsyncSageMakerRuntimeHTTP2Client:
|
|
|
56
56
|
self._plugins = plugins
|
|
57
57
|
self._derive_lock = asyncio.Lock()
|
|
58
58
|
self._setup_done = False
|
|
59
|
+
self._closed = False
|
|
59
60
|
self._retry_strategy_resolver = RetryStrategyResolver()
|
|
60
61
|
self._client_plugins: list[Plugin] = [aws_user_agent_plugin, user_agent_plugin]
|
|
61
62
|
|
|
@@ -96,6 +97,25 @@ class AsyncSageMakerRuntimeHTTP2Client:
|
|
|
96
97
|
)
|
|
97
98
|
self._setup_done = True
|
|
98
99
|
|
|
100
|
+
async def close(self) -> None:
|
|
101
|
+
"""Close this client and any resources held by its transport."""
|
|
102
|
+
if self._closed:
|
|
103
|
+
return
|
|
104
|
+
async with self._derive_lock:
|
|
105
|
+
if self._closed:
|
|
106
|
+
return
|
|
107
|
+
self._closed = True
|
|
108
|
+
if self._setup_done and self._config is not None:
|
|
109
|
+
await close(self._config.transport)
|
|
110
|
+
|
|
111
|
+
async def __aenter__(self) -> Self:
|
|
112
|
+
if self._closed:
|
|
113
|
+
raise RuntimeError("Cannot enter a client that has been closed.")
|
|
114
|
+
return self
|
|
115
|
+
|
|
116
|
+
async def __aexit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> None:
|
|
117
|
+
await self.close()
|
|
118
|
+
|
|
99
119
|
async def invoke_endpoint_with_bidirectional_stream(
|
|
100
120
|
self,
|
|
101
121
|
input: InvokeEndpointWithBidirectionalStreamInput,
|
|
@@ -154,6 +174,11 @@ class AsyncSageMakerRuntimeHTTP2Client:
|
|
|
154
174
|
Returns:
|
|
155
175
|
A `DuplexEventStream` for bidirectional streaming.
|
|
156
176
|
"""
|
|
177
|
+
if self._closed:
|
|
178
|
+
raise RuntimeError(
|
|
179
|
+
"Cannot invoke an operation on a client that has been closed."
|
|
180
|
+
)
|
|
181
|
+
|
|
157
182
|
operation_plugins: list[Plugin] = []
|
|
158
183
|
if plugins:
|
|
159
184
|
operation_plugins.extend(plugins)
|
|
@@ -202,20 +227,3 @@ class AsyncSageMakerRuntimeHTTP2Client:
|
|
|
202
227
|
ResponseStreamEvent,
|
|
203
228
|
_ResponseStreamEventDeserializer().deserialize,
|
|
204
229
|
)
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
if TYPE_CHECKING:
|
|
208
|
-
# Deprecated alias for backwards compatibility, to be removed.
|
|
209
|
-
SageMakerRuntimeHTTP2Client = AsyncSageMakerRuntimeHTTP2Client
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
def __getattr__(name: str) -> Any:
|
|
213
|
-
if name == "SageMakerRuntimeHTTP2Client":
|
|
214
|
-
warnings.warn(
|
|
215
|
-
"SageMakerRuntimeHTTP2Client is deprecated, use AsyncSageMakerRuntimeHTTP2Client instead. "
|
|
216
|
-
"This alias will be removed in a future version.",
|
|
217
|
-
DeprecationWarning,
|
|
218
|
-
stacklevel=2,
|
|
219
|
-
)
|
|
220
|
-
return AsyncSageMakerRuntimeHTTP2Client
|
|
221
|
-
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
@@ -18,7 +18,7 @@ from smithy_core.aio.interfaces.auth import AuthScheme
|
|
|
18
18
|
from smithy_core.aio.interfaces.identity import IdentityResolver
|
|
19
19
|
from smithy_core.interceptors import Interceptor
|
|
20
20
|
from smithy_core.shapes import ShapeID
|
|
21
|
-
from smithy_http.aio.
|
|
21
|
+
from smithy_http.aio.aiohttp import AIOHTTPClient
|
|
22
22
|
|
|
23
23
|
from ._private.schemas import (
|
|
24
24
|
AMAZON_SAGE_MAKER_RUNTIME_HTTP2 as _SCHEMA_AMAZON_SAGE_MAKER_RUNTIME_HTTP2,
|
|
@@ -132,7 +132,7 @@ class AsyncSageMakerRuntimeHTTP2Config(AsyncAwsConfig):
|
|
|
132
132
|
}
|
|
133
133
|
),
|
|
134
134
|
"auth_scheme_resolver": FieldSpec(default_factory=HTTPAuthSchemeResolver),
|
|
135
|
-
"transport": FieldSpec(default_factory=lambda:
|
|
135
|
+
"transport": FieldSpec(default_factory=lambda: AIOHTTPClient()),
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/.gitignore
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/docs/README.md
RENAMED
|
File without changes
|
{aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/docs/index.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/tests/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{aws_sdk_sagemaker_runtime_http2-0.10.0 → aws_sdk_sagemaker_runtime_http2-0.11.0}/zensical.toml
RENAMED
|
File without changes
|