contree-client 0.1.3__tar.gz → 0.2.1.dev0__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 (43) hide show
  1. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/PKG-INFO +1 -1
  2. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/contree_client/__init__.py +12 -0
  3. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/contree_client/aiohttp.py +7 -1
  4. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/contree_client/base.py +602 -21
  5. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/contree_client/models.py +300 -6
  6. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/contree_client/operations.py +166 -2
  7. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/contree_client/runtime.py +8 -3
  8. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/contree_client/spec_info.py +667 -3
  9. contree_client-0.2.1.dev0/pyproject.toml +78 -0
  10. contree_client-0.1.3/pyproject.toml → contree_client-0.2.1.dev0/pyproject.toml.orig +1 -1
  11. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/tests/conftest.py +13 -0
  12. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/tests/stub_server.py +125 -4
  13. contree_client-0.2.1.dev0/tests/test_aiohttp_payload_interruption.py +234 -0
  14. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/tests/test_integration.py +197 -3
  15. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/tests/test_retry.py +15 -0
  16. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/LICENSE +0 -0
  17. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/README.md +0 -0
  18. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/contree_client/asyncio.py +0 -0
  19. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/contree_client/exceptions.py +0 -0
  20. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/contree_client/http.py +0 -0
  21. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/contree_client/httpx.py +0 -0
  22. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/contree_client/profiles.py +0 -0
  23. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/contree_client/py.typed +0 -0
  24. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/contree_client/requests.py +0 -0
  25. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/contree_client/sync.py +0 -0
  26. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/contree_client/testing.py +0 -0
  27. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/contree_client/types.py +0 -0
  28. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/contree_client/urllib3.py +0 -0
  29. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/tests/test_autodetect.py +0 -0
  30. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/tests/test_clients.py +0 -0
  31. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/tests/test_file_helpers.py +0 -0
  32. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/tests/test_interface.py +0 -0
  33. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/tests/test_keepalive.py +0 -0
  34. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/tests/test_logging.py +0 -0
  35. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/tests/test_models.py +0 -0
  36. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/tests/test_operation_helpers.py +0 -0
  37. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/tests/test_operations.py +0 -0
  38. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/tests/test_pagination.py +0 -0
  39. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/tests/test_profiles.py +0 -0
  40. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/tests/test_runtime.py +0 -0
  41. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/tests/test_sse.py +0 -0
  42. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/tests/test_stream_lifecycle.py +0 -0
  43. {contree_client-0.1.3 → contree_client-0.2.1.dev0}/tests/test_testing.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: contree-client
3
- Version: 0.1.3
3
+ Version: 0.2.1.dev0
4
4
  Summary: Python client for the Contree API, generated from the OpenAPI specification
5
5
  Author: Dmitry Orlov
6
6
  Author-email: Dmitry Orlov <mosquito@nebius.com>
@@ -38,6 +38,7 @@ from .exceptions import (
38
38
  from .models import (
39
39
  ACTIVE_STATUSES,
40
40
  TERMINAL_STATUSES,
41
+ ClosableStreamRepr,
41
42
  ContreeModel,
42
43
  DirectoryList,
43
44
  Error,
@@ -53,11 +54,15 @@ from .models import (
53
54
  EventDataStream,
54
55
  EventDataTruncated,
55
56
  EventResources,
57
+ ExecSpec,
56
58
  File,
57
59
  FileItem,
58
60
  FileResponse,
59
61
  FilesListResponse,
60
62
  FileSpec,
63
+ GrepMatch,
64
+ GrepResult,
65
+ GrepSubmatch,
61
66
  Image,
62
67
  ImageImportMetadata,
63
68
  ImageImportMetadataRegistry,
@@ -66,6 +71,7 @@ from .models import (
66
71
  ImageImportRegistryCredentials,
67
72
  ImageImportRequest,
68
73
  ImageListResponse,
74
+ InstanceNetworking,
69
75
  InstanceResourcesLimits,
70
76
  InstanceResult,
71
77
  InstanceResultResources,
@@ -106,6 +112,7 @@ __all__ = [
106
112
  "DEFAULT_BASE_URL",
107
113
  "TERMINAL_STATUSES",
108
114
  "BadRequestError",
115
+ "ClosableStreamRepr",
109
116
  "ConflictError",
110
117
  "ContreeAPIError",
111
118
  "ContreeError",
@@ -124,6 +131,7 @@ __all__ = [
124
131
  "EventDataStream",
125
132
  "EventDataTruncated",
126
133
  "EventResources",
134
+ "ExecSpec",
127
135
  "File",
128
136
  "FileItem",
129
137
  "FileResponse",
@@ -131,6 +139,9 @@ __all__ = [
131
139
  "FilesListResponse",
132
140
  "ForbiddenError",
133
141
  "GoneError",
142
+ "GrepMatch",
143
+ "GrepResult",
144
+ "GrepSubmatch",
134
145
  "Image",
135
146
  "ImageImportMetadata",
136
147
  "ImageImportMetadataRegistry",
@@ -139,6 +150,7 @@ __all__ = [
139
150
  "ImageImportRegistryCredentials",
140
151
  "ImageImportRequest",
141
152
  "ImageListResponse",
153
+ "InstanceNetworking",
142
154
  "InstanceResourcesLimits",
143
155
  "InstanceResult",
144
156
  "InstanceResultResources",
@@ -35,6 +35,7 @@ class ContreeAsyncClient(base.ContreeAsyncClient):
35
35
  retryable_errors = (
36
36
  aiohttp.ClientConnectionError,
37
37
  aiohttp.ServerConnectionError,
38
+ aiohttp.ClientPayloadError,
38
39
  )
39
40
  nonretryable_errors = (TimeoutError, asyncio.TimeoutError)
40
41
 
@@ -126,7 +127,12 @@ class ContreeAsyncClient(base.ContreeAsyncClient):
126
127
  ) as response:
127
128
  self.log.debug("%s %s -> %d (stream)", spec.method, url, response.status)
128
129
  if not 200 <= response.status < 300:
129
- body = await response.read()
130
+ try:
131
+ body = await response.read()
132
+ except self.retryable_errors:
133
+ # The status is authoritative even when its optional
134
+ # diagnostic body is interrupted.
135
+ body = b""
130
136
  # auto_decompress=False applies to the payload only:
131
137
  # the error body must still be decoded, or the parsed
132
138
  # server message is lost