s2-sdk 0.2.2__tar.gz → 0.3.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.
Files changed (71) hide show
  1. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/PKG-INFO +3 -3
  2. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/pyproject.toml +4 -7
  3. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/src/s2_sdk/__init__.py +6 -0
  4. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/src/s2_sdk/_client.py +20 -16
  5. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/src/s2_sdk/_mappers.py +39 -0
  6. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/src/s2_sdk/_ops.py +68 -0
  7. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/src/s2_sdk/_types.py +36 -0
  8. s2_sdk-0.2.2/.github/workflows/ci.yml +0 -71
  9. s2_sdk-0.2.2/.github/workflows/pr-title.yml +0 -34
  10. s2_sdk-0.2.2/.github/workflows/release-please.yml +0 -29
  11. s2_sdk-0.2.2/.github/workflows/release.yml +0 -21
  12. s2_sdk-0.2.2/.gitignore +0 -19
  13. s2_sdk-0.2.2/.gitmodules +0 -3
  14. s2_sdk-0.2.2/.python-version +0 -1
  15. s2_sdk-0.2.2/.readthedocs.yaml +0 -20
  16. s2_sdk-0.2.2/.release-please-manifest.json +0 -3
  17. s2_sdk-0.2.2/CHANGELOG.md +0 -63
  18. s2_sdk-0.2.2/CODEOWNERS +0 -1
  19. s2_sdk-0.2.2/docs/Makefile +0 -20
  20. s2_sdk-0.2.2/docs/make.bat +0 -35
  21. s2_sdk-0.2.2/docs/source/_static/s2-logo-black.png +0 -0
  22. s2_sdk-0.2.2/docs/source/_static/s2-logo-white.png +0 -0
  23. s2_sdk-0.2.2/docs/source/api-reference.md +0 -185
  24. s2_sdk-0.2.2/docs/source/conf.py +0 -46
  25. s2_sdk-0.2.2/docs/source/index.md +0 -8
  26. s2_sdk-0.2.2/examples/consumer.py +0 -37
  27. s2_sdk-0.2.2/examples/docs/account_and_basins.py +0 -109
  28. s2_sdk-0.2.2/examples/docs/configuration.py +0 -57
  29. s2_sdk-0.2.2/examples/docs/encryption.py +0 -84
  30. s2_sdk-0.2.2/examples/docs/metrics.py +0 -63
  31. s2_sdk-0.2.2/examples/docs/overview.py +0 -20
  32. s2_sdk-0.2.2/examples/docs/streams.py +0 -168
  33. s2_sdk-0.2.2/examples/producer.py +0 -44
  34. s2_sdk-0.2.2/pytest.ini +0 -21
  35. s2_sdk-0.2.2/release-please-config.json +0 -14
  36. s2_sdk-0.2.2/tests/__init__.py +0 -0
  37. s2_sdk-0.2.2/tests/conftest.py +0 -142
  38. s2_sdk-0.2.2/tests/test_account_ops.py +0 -293
  39. s2_sdk-0.2.2/tests/test_basin_ops.py +0 -546
  40. s2_sdk-0.2.2/tests/test_batching.py +0 -117
  41. s2_sdk-0.2.2/tests/test_client.py +0 -677
  42. s2_sdk-0.2.2/tests/test_compression.py +0 -33
  43. s2_sdk-0.2.2/tests/test_correctness.py +0 -71
  44. s2_sdk-0.2.2/tests/test_metrics_ops.py +0 -192
  45. s2_sdk-0.2.2/tests/test_producer.py +0 -335
  46. s2_sdk-0.2.2/tests/test_retrier.py +0 -26
  47. s2_sdk-0.2.2/tests/test_s2s_protocol.py +0 -86
  48. s2_sdk-0.2.2/tests/test_session.py +0 -743
  49. s2_sdk-0.2.2/tests/test_stream_ops.py +0 -989
  50. s2_sdk-0.2.2/tests/test_validators.py +0 -27
  51. s2_sdk-0.2.2/update_specs +0 -17
  52. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/LICENSE +0 -0
  53. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/README.md +0 -0
  54. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/src/s2_sdk/_append_session.py +0 -0
  55. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/src/s2_sdk/_batching.py +0 -0
  56. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/src/s2_sdk/_compression.py +0 -0
  57. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/src/s2_sdk/_exceptions.py +0 -0
  58. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/src/s2_sdk/_frame_signal.py +0 -0
  59. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/src/s2_sdk/_generated/__init__.py +0 -0
  60. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/src/s2_sdk/_generated/s2/__init__.py +0 -0
  61. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/src/s2_sdk/_generated/s2/v1/__init__.py +0 -0
  62. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/src/s2_sdk/_generated/s2/v1/s2_pb2.py +0 -0
  63. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/src/s2_sdk/_generated/s2/v1/s2_pb2.pyi +0 -0
  64. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/src/s2_sdk/_producer.py +0 -0
  65. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/src/s2_sdk/_retrier.py +0 -0
  66. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/src/s2_sdk/_s2s/__init__.py +0 -0
  67. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/src/s2_sdk/_s2s/_append_session.py +0 -0
  68. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/src/s2_sdk/_s2s/_protocol.py +0 -0
  69. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/src/s2_sdk/_s2s/_read_session.py +0 -0
  70. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/src/s2_sdk/_validators.py +0 -0
  71. {s2_sdk-0.2.2 → s2_sdk-0.3.0}/src/s2_sdk/py.typed +0 -0
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: s2-sdk
3
- Version: 0.2.2
3
+ Version: 0.3.0
4
4
  Summary: Python SDK for s2.dev
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
7
- Requires-Python: >=3.11
8
7
  Requires-Dist: h2>=4.1.0
9
- Requires-Dist: protobuf<7.0.0,>=6.31.1
8
+ Requires-Dist: protobuf>=6.31.1,<7.0.0
10
9
  Requires-Dist: zstandard>=0.23.0
10
+ Requires-Python: >=3.11
11
11
  Description-Content-Type: text/markdown
12
12
 
13
13
  # s2-sdk
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "s2-sdk"
3
- version = "0.2.2"
3
+ version = "0.3.0"
4
4
  description = "Python SDK for s2.dev"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -35,11 +35,8 @@ docs = [
35
35
  ]
36
36
 
37
37
  [build-system]
38
- requires = ["hatchling"]
39
- build-backend = "hatchling.build"
40
-
41
- [tool.hatch.build.targets.wheel]
42
- packages = ["src/s2_sdk"]
38
+ requires = ["uv_build>=0.11.14,<0.12"]
39
+ build-backend = "uv_build"
43
40
 
44
41
  [tool.mypy]
45
42
  files = ["src/s2_sdk/", "tests/"]
@@ -65,7 +62,7 @@ lint = "uv run ruff check"
65
62
  lint-fix = "uv run ruff check --fix"
66
63
  format = "uv run ruff format"
67
64
  format-check = "uv run ruff format --check"
68
- type-check = "uv run mypy"
65
+ type-check = "uv run --group test mypy"
69
66
  cq-check = ["lint", "format-check", "type-check"]
70
67
  cq-fix = ["lint-fix", "format", "type-check"]
71
68
  docs-check = "uv run --group docs sphinx-build -W -b html docs/source docs/build/html"
@@ -31,6 +31,9 @@ from s2_sdk._types import (
31
31
  Compression,
32
32
  Encryption,
33
33
  Endpoints,
34
+ EnsuredBasinInfo,
35
+ EnsuredStreamInfo,
36
+ EnsureStatus,
34
37
  ExactMatch,
35
38
  Gauge,
36
39
  IndexedAppendAck,
@@ -82,6 +85,9 @@ __all__ = [
82
85
  "AppendRetryPolicy",
83
86
  "Batching",
84
87
  "Endpoints",
88
+ "EnsureStatus",
89
+ "EnsuredBasinInfo",
90
+ "EnsuredStreamInfo",
85
91
  "Record",
86
92
  "AppendInput",
87
93
  "AppendAck",
@@ -4,7 +4,7 @@ import asyncio
4
4
  import json as json_lib
5
5
  import ssl
6
6
  import time
7
- from collections.abc import AsyncGenerator, AsyncIterator, Callable
7
+ from collections.abc import AsyncGenerator, AsyncIterator, Callable, Iterable
8
8
  from contextlib import asynccontextmanager
9
9
  from dataclasses import dataclass, field
10
10
  from importlib.metadata import version
@@ -164,7 +164,7 @@ class HttpClient:
164
164
  resp_body, _ENCODING_COMPRESSION[content_encoding]
165
165
  )
166
166
 
167
- response = Response(status_code, resp_body)
167
+ response = Response(status_code, resp_body, resp_headers)
168
168
  except TransportError:
169
169
  raise
170
170
  except asyncio.TimeoutError:
@@ -276,7 +276,7 @@ class HttpClient:
276
276
  url_path: str,
277
277
  extra_headers: dict[str, str] | None = None,
278
278
  ) -> list[tuple[str, str]]:
279
- h = [
279
+ headers = [
280
280
  (":method", method),
281
281
  (":path", url_path),
282
282
  (":scheme", self._scheme),
@@ -284,14 +284,16 @@ class HttpClient:
284
284
  ("user-agent", _USER_AGENT),
285
285
  ]
286
286
  if self._compression != Compression.NONE:
287
- h.append(("accept-encoding", _COMPRESSION_ENCODING[self._compression]))
287
+ headers.append(
288
+ ("accept-encoding", _COMPRESSION_ENCODING[self._compression])
289
+ )
288
290
  if self._headers:
289
291
  for k, v in self._headers.items():
290
- h.append((k.lower(), v))
292
+ headers.append((k.lower(), v))
291
293
  if extra_headers:
292
294
  for k, v in extra_headers.items():
293
- h.append((k.lower(), v))
294
- return h
295
+ headers.append((k.lower(), v))
296
+ return headers
295
297
 
296
298
 
297
299
  class ConnectionPool:
@@ -433,22 +435,24 @@ class ConnectionPool:
433
435
 
434
436
 
435
437
  class Response:
436
- __slots__ = ("status_code", "_content")
438
+ __slots__ = ("status_code", "content", "headers")
437
439
 
438
- def __init__(self, status_code: int, content: bytes) -> None:
440
+ def __init__(
441
+ self,
442
+ status_code: int,
443
+ content: bytes,
444
+ headers: Iterable[tuple[str, str]] = (),
445
+ ) -> None:
439
446
  self.status_code = status_code
440
- self._content = content
441
-
442
- @property
443
- def content(self) -> bytes:
444
- return self._content
447
+ self.content = content
448
+ self.headers = tuple(headers)
445
449
 
446
450
  @property
447
451
  def text(self) -> str:
448
- return self._content.decode("utf-8", errors="replace")
452
+ return self.content.decode("utf-8", errors="replace")
449
453
 
450
454
  def json(self) -> Any:
451
- return json_lib.loads(self._content)
455
+ return json_lib.loads(self.content)
452
456
 
453
457
 
454
458
  class StreamingResponse:
@@ -1,3 +1,4 @@
1
+ from collections.abc import Iterable
1
2
  from datetime import datetime
2
3
  from typing import Any, Literal
3
4
 
@@ -12,6 +13,9 @@ from s2_sdk._types import (
12
13
  BasinInfo,
13
14
  BasinScope,
14
15
  Encryption,
16
+ EnsuredBasinInfo,
17
+ EnsuredStreamInfo,
18
+ EnsureStatus,
15
19
  ExactMatch,
16
20
  Gauge,
17
21
  Label,
@@ -39,6 +43,13 @@ from s2_sdk._types import (
39
43
 
40
44
  _ReadStart = SeqNum | Timestamp | TailOffset
41
45
 
46
+ _S2_PROVISION_RESULT_HEADER = "s2-provision-result"
47
+ _ENSURE_STATUS_FROM_PROVISION_RESULT = {
48
+ "created": EnsureStatus.CREATED,
49
+ "updated": EnsureStatus.CONFIG_UPDATED,
50
+ "noop": EnsureStatus.CONFIG_UNCHANGED,
51
+ }
52
+
42
53
 
43
54
  def basin_config_to_json(config: BasinConfig | None) -> dict[str, Any] | None:
44
55
  if config is None:
@@ -147,6 +158,25 @@ def basin_info_from_json(data: dict[str, Any]) -> BasinInfo:
147
158
  )
148
159
 
149
160
 
161
+ def _ensure_status_from_headers(headers: Iterable[tuple[str, str]]) -> EnsureStatus:
162
+ for k, v in headers:
163
+ if k == _S2_PROVISION_RESULT_HEADER:
164
+ status = _ENSURE_STATUS_FROM_PROVISION_RESULT.get(v)
165
+ if status is None:
166
+ raise ValueError(f"unrecognized s2-provision-result header: {v!r}")
167
+ return status
168
+ raise ValueError("missing s2-provision-result header")
169
+
170
+
171
+ def ensured_basin_info_from_json_and_headers(
172
+ data: dict[str, Any], headers: Iterable[tuple[str, str]]
173
+ ) -> EnsuredBasinInfo:
174
+ return EnsuredBasinInfo(
175
+ basin=basin_info_from_json(data),
176
+ status=_ensure_status_from_headers(headers),
177
+ )
178
+
179
+
150
180
  def stream_info_from_json(data: dict[str, Any]) -> StreamInfo:
151
181
  created_at = datetime.fromisoformat(data["created_at"])
152
182
  deleted_at_str = data.get("deleted_at")
@@ -160,6 +190,15 @@ def stream_info_from_json(data: dict[str, Any]) -> StreamInfo:
160
190
  )
161
191
 
162
192
 
193
+ def ensured_stream_info_from_json_and_headers(
194
+ data: dict[str, Any], headers: Iterable[tuple[str, str]]
195
+ ) -> EnsuredStreamInfo:
196
+ return EnsuredStreamInfo(
197
+ stream=stream_info_from_json(data),
198
+ status=_ensure_status_from_headers(headers),
199
+ )
200
+
201
+
163
202
  def _resource_set_to_json(
164
203
  rs: ExactMatch | PrefixMatch | None,
165
204
  ) -> dict[str, str] | None:
@@ -19,6 +19,8 @@ from s2_sdk._mappers import (
19
19
  basin_config_to_json,
20
20
  basin_info_from_json,
21
21
  basin_reconfiguration_to_json,
22
+ ensured_basin_info_from_json_and_headers,
23
+ ensured_stream_info_from_json_and_headers,
22
24
  metric_set_from_json,
23
25
  read_batch_from_proto,
24
26
  read_limit_params,
@@ -192,6 +194,41 @@ class S2:
192
194
  )
193
195
  return basin_info_from_json(response.json())
194
196
 
197
+ @fallible
198
+ async def ensure_basin(
199
+ self, name: str, *, config: types.BasinConfig | None = None
200
+ ) -> types.EnsuredBasinInfo:
201
+ """Ensure a basin.
202
+
203
+ If the basin doesn’t exist, creates the basin with specified configuration.
204
+
205
+ If the basin already exists:
206
+
207
+ - Its configuration is updated to the specified configuration, if different.
208
+ - Its configuration is unchanged, if the specified configuration is same.
209
+
210
+ Args:
211
+ name: Name of the basin.
212
+ config: Configuration for the basin.
213
+
214
+ Returns:
215
+ Information about the ensured basin.
216
+
217
+ Note:
218
+ ``name`` must be globally unique, 8--48 characters, comprising lowercase
219
+ letters, numbers, and hyphens. It cannot begin or end with a hyphen.
220
+ """
221
+ validate_basin(name)
222
+ json = None
223
+ if config is not None:
224
+ json = {"config": basin_config_to_json(config)}
225
+ response = await self._retrier(
226
+ self._account_client.unary_request, "PUT", f"/v1/basins/{name}", json=json
227
+ )
228
+ return ensured_basin_info_from_json_and_headers(
229
+ response.json(), response.headers
230
+ )
231
+
195
232
  def basin(self, name: str) -> "S2Basin":
196
233
  """Get an :class:`S2Basin` for performing basin-level operations.
197
234
 
@@ -618,6 +655,37 @@ class S2Basin:
618
655
  )
619
656
  return stream_info_from_json(response.json())
620
657
 
658
+ @fallible
659
+ async def ensure_stream(
660
+ self,
661
+ name: str,
662
+ *,
663
+ config: types.StreamConfig | None = None,
664
+ ) -> types.EnsuredStreamInfo:
665
+ """Ensure a stream.
666
+
667
+ If the stream doesn’t exist, creates the stream with specified configuration.
668
+
669
+ If the stream already exists:
670
+
671
+ - Its configuration is updated to the specified configuration, if different.
672
+ - Its configuration is unchanged, if the specified configuration is same.
673
+
674
+ Args:
675
+ name: Name of the stream.
676
+ config: Configuration for the stream.
677
+
678
+ Returns:
679
+ Information about the ensured stream.
680
+ """
681
+ json = stream_config_to_json(config)
682
+ response = await self._retrier(
683
+ self._client.unary_request, "PUT", _stream_path(name), json=json
684
+ )
685
+ return ensured_stream_info_from_json_and_headers(
686
+ response.json(), response.headers
687
+ )
688
+
621
689
  def stream(
622
690
  self,
623
691
  name: str,
@@ -531,6 +531,42 @@ class StreamInfo:
531
531
  """Encryption algorithm for this stream, if encryption is enabled."""
532
532
 
533
533
 
534
+ class EnsureStatus(_DocEnum):
535
+ """Outcome of an ensure operation."""
536
+
537
+ CREATED = "created", "Resource created."
538
+ CONFIG_UPDATED = (
539
+ "config-updated",
540
+ "Resource already existed, and its config was updated.",
541
+ )
542
+ CONFIG_UNCHANGED = (
543
+ "config-unchanged",
544
+ "Resource already existed, and its config is unchanged.",
545
+ )
546
+
547
+
548
+ @dataclass(slots=True)
549
+ class EnsuredBasinInfo:
550
+ """Basin information with ensure operation outcome."""
551
+
552
+ basin: BasinInfo
553
+ """Basin information."""
554
+
555
+ status: EnsureStatus
556
+ """Outcome of the ensure operation."""
557
+
558
+
559
+ @dataclass(slots=True)
560
+ class EnsuredStreamInfo:
561
+ """Stream information with ensure operation outcome."""
562
+
563
+ stream: StreamInfo
564
+ """Stream information."""
565
+
566
+ status: EnsureStatus
567
+ """Outcome of the ensure operation."""
568
+
569
+
534
570
  @dataclass(slots=True)
535
571
  class ExactMatch:
536
572
  """Match only the resource with this exact name."""
@@ -1,71 +0,0 @@
1
- name: CI
2
-
3
- # NOTE: keep UV_VERSION in sync with uv-version in s2-lite-integration-tests sdks JSON below.
4
- env:
5
- UV_VERSION: "0.11.6"
6
-
7
- on:
8
- pull_request:
9
- types: [opened, synchronize, ready_for_review, reopened]
10
- jobs:
11
- local-checks:
12
- name: Local Checks (code quality, unit tests, docs build)
13
- runs-on: ubuntu-latest
14
- steps:
15
- - name: Checkout repository
16
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
17
- - name: Install uv
18
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
19
- with:
20
- version: ${{ env.UV_VERSION }}
21
- - name: Sync dependencies
22
- run: |
23
- uv sync --all-groups
24
- - name: Code quality check
25
- run: uv run poe cq-check
26
- - name: Unit tests
27
- run: uv run pytest tests/ -v -m 'not (account or basin or stream or metrics or correctness)'
28
- - name: Check docs build
29
- working-directory: ./docs
30
- run: |
31
- make html
32
- s2-cloud-integration-tests:
33
- name: s2-cloud integration tests
34
- runs-on: ubuntu-latest
35
- steps:
36
- - name: Checkout repository
37
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
38
- - name: Install uv
39
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
40
- with:
41
- version: ${{ env.UV_VERSION }}
42
- - name: Sync dependencies
43
- run: uv sync --group test
44
- - name: Run integration tests
45
- env:
46
- S2_ACCESS_TOKEN: ${{ secrets.S2_ACCESS_TOKEN }}
47
- run: uv run pytest tests/ -v -s -m 'account or basin or stream or metrics'
48
-
49
- build-s2-lite:
50
- name: Build s2-lite
51
- uses: s2-streamstore/s2/.github/workflows/build-s2-lite.yml@main
52
-
53
- s2-lite-integration-tests:
54
- name: s2-lite integration tests
55
- needs: build-s2-lite
56
- uses: s2-streamstore/s2/.github/workflows/sdk-tests.yml@main
57
- with:
58
- server-binary: server
59
- server-args: "--port 8080"
60
- server-port: 8080
61
- sdks: |
62
- [
63
- {
64
- "name": "python",
65
- "repo": "${{ github.repository }}",
66
- "ref": "${{ github.ref }}",
67
- "lang": "python",
68
- "uv-version": "0.11.6",
69
- "test_cmd": "uv run pytest tests/ -v -s -m '(account or basin or stream) and not access_tokens'"
70
- }
71
- ]
@@ -1,34 +0,0 @@
1
- name: PR Title
2
-
3
- on:
4
- pull_request:
5
- types: [opened, edited, synchronize, reopened]
6
-
7
- permissions:
8
- pull-requests: read
9
-
10
- jobs:
11
- validate:
12
- name: Validate PR Title
13
- runs-on: ubuntu-latest
14
- steps:
15
- - uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
16
- env:
17
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18
- with:
19
- types: |
20
- feat
21
- fix
22
- docs
23
- perf
24
- refactor
25
- style
26
- test
27
- chore
28
- ci
29
- revert
30
- requireScope: false
31
- subjectPattern: ^.+$
32
- subjectPatternError: |
33
- The subject "{subject}" is not valid.
34
- Please use a non-empty subject after the type/scope.
@@ -1,29 +0,0 @@
1
- name: Release Please
2
-
3
- on:
4
- push:
5
- branches: [main]
6
- workflow_dispatch:
7
-
8
- permissions:
9
- contents: write
10
- pull-requests: write
11
-
12
- jobs:
13
- release-please:
14
- runs-on: ubuntu-latest
15
- outputs:
16
- release_created: ${{ steps.release.outputs.release_created }}
17
- tag_name: ${{ steps.release.outputs.tag_name }}
18
- steps:
19
- - uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
20
- id: app-token
21
- with:
22
- app-id: ${{ secrets.RELEASE_PLZ_APP_ID }}
23
- private-key: ${{ secrets.RELEASE_PLZ_APP_PRIVATE_KEY }}
24
- - uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
25
- id: release
26
- with:
27
- config-file: release-please-config.json
28
- manifest-file: .release-please-manifest.json
29
- token: ${{ steps.app-token.outputs.token }}
@@ -1,21 +0,0 @@
1
- name: Release
2
-
3
- on:
4
- push:
5
- tags: ["v[0-9]+.[0-9]+.[0-9]+*"]
6
-
7
- jobs:
8
- pypi-publish:
9
- name: Build and publish to PyPI
10
- runs-on: ubuntu-latest
11
- permissions:
12
- id-token: write
13
- steps:
14
- - name: Checkout repository
15
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
16
- - name: Install uv
17
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
18
- - name: Build package
19
- run: uv build
20
- - name: Publish package to PyPI
21
- uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
s2_sdk-0.2.2/.gitignore DELETED
@@ -1,19 +0,0 @@
1
- # Python-generated files
2
- __pycache__/
3
- *.py[oc]
4
- build/
5
- dist/
6
- wheels/
7
- *.egg-info
8
-
9
- # Virtual environments
10
- .venv
11
-
12
- # Lock file
13
- uv.lock
14
-
15
- # Sphinx
16
- docs/build
17
-
18
- # Claude Code
19
- .claude/
s2_sdk-0.2.2/.gitmodules DELETED
@@ -1,3 +0,0 @@
1
- [submodule "s2-specs"]
2
- path = s2-specs
3
- url = https://github.com/s2-streamstore/s2-specs.git
@@ -1 +0,0 @@
1
- 3.11
@@ -1,20 +0,0 @@
1
- # Read the Docs configuration file
2
- # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3
-
4
- version: 2
5
-
6
- build:
7
- os: ubuntu-24.04
8
- tools:
9
- python: "3.11"
10
- jobs:
11
- create_environment:
12
- - asdf plugin add uv
13
- - asdf install uv 0.8.2
14
- - asdf global uv 0.8.2
15
- - UV_PROJECT_ENVIRONMENT=$READTHEDOCS_VIRTUALENV_PATH uv sync --group docs
16
- install:
17
- - "true"
18
-
19
- sphinx:
20
- configuration: docs/source/conf.py
@@ -1,3 +0,0 @@
1
- {
2
- ".": "0.2.2"
3
- }
s2_sdk-0.2.2/CHANGELOG.md DELETED
@@ -1,63 +0,0 @@
1
- # Changelog
2
-
3
- ## [0.2.2](https://github.com/s2-streamstore/s2-sdk-python/compare/v0.2.1...v0.2.2) (2026-05-17)
4
-
5
-
6
- ### Bug Fixes
7
-
8
- * uncapped and eager backoff calculation ([#52](https://github.com/s2-streamstore/s2-sdk-python/issues/52)) ([89ba250](https://github.com/s2-streamstore/s2-sdk-python/commit/89ba250d48c2d388bc3c9ec7063dcc8c12afe515))
9
-
10
- ## [0.2.1](https://github.com/s2-streamstore/s2-sdk-python/compare/v0.2.0...v0.2.1) (2026-05-11)
11
-
12
-
13
- ### Bug Fixes
14
-
15
- * batch accumulator doesn't flush when source iter raises ([#49](https://github.com/s2-streamstore/s2-sdk-python/issues/49)) ([cd20814](https://github.com/s2-streamstore/s2-sdk-python/commit/cd208149b2d69a2e075a44f6a894ffc469d57014))
16
- * incorrect frame signal reset condition after resending append inputs ([#47](https://github.com/s2-streamstore/s2-sdk-python/issues/47)) ([49c3237](https://github.com/s2-streamstore/s2-sdk-python/commit/49c3237a7c37cc5b63f0327688aab53ac468412d))
17
- * pending streams not failed when GOAWAY is received ([#50](https://github.com/s2-streamstore/s2-sdk-python/issues/50)) ([74baa61](https://github.com/s2-streamstore/s2-sdk-python/commit/74baa612bf102d12b850301fc678d4df6f1c670d))
18
-
19
- ## [0.2.0](https://github.com/s2-streamstore/s2-sdk-python/compare/v0.1.3...v0.2.0) (2026-04-23)
20
-
21
-
22
- ### Features
23
-
24
- * encryption support ([#37](https://github.com/s2-streamstore/s2-sdk-python/issues/37)) ([2106eda](https://github.com/s2-streamstore/s2-sdk-python/commit/2106eda2f4ba531584f6e66f1b703aa4d519a7b7))
25
-
26
- ## [0.1.3](https://github.com/s2-streamstore/s2-sdk-python/compare/v0.1.2...v0.1.3) (2026-04-14)
27
-
28
-
29
- ### Bug Fixes
30
-
31
- * incorrect tracking of limits after client-side filtering ([#34](https://github.com/s2-streamstore/s2-sdk-python/issues/34)) ([d69e4f0](https://github.com/s2-streamstore/s2-sdk-python/commit/d69e4f0f7e7dc8ec997bd675b96944577bc3036c))
32
-
33
- ## [0.1.2](https://github.com/s2-streamstore/s2-sdk-python/compare/v0.1.1...v0.1.2) (2026-04-11)
34
-
35
-
36
- ### Bug Fixes
37
-
38
- * `CommandRecord.trim` raises `OverflowError` instead of `S2ClientError` ([#29](https://github.com/s2-streamstore/s2-sdk-python/issues/29)) ([f394b1e](https://github.com/s2-streamstore/s2-sdk-python/commit/f394b1ec769d395493256cb89adbb97d2485e077))
39
- * ack for an already cancelled ticket future crashes append session ([#27](https://github.com/s2-streamstore/s2-sdk-python/issues/27)) ([496acfe](https://github.com/s2-streamstore/s2-sdk-python/commit/496acfe4d8f9132f83651614e553627bf0e0ca27))
40
- * linger timeout closes async iterator in `append_record_batches` ([#28](https://github.com/s2-streamstore/s2-sdk-python/issues/28)) ([aaf4bfe](https://github.com/s2-streamstore/s2-sdk-python/commit/aaf4bfe08bd517ee8b429cdc805f1479e08d1343))
41
- * malformed terminal message raises `AttributeError` instead of `S2ServerError` ([#30](https://github.com/s2-streamstore/s2-sdk-python/issues/30)) ([fe08739](https://github.com/s2-streamstore/s2-sdk-python/commit/fe0873989fb3c57dfa036523b9eadbe3a15e8362))
42
- * received data not fully acknowledged during h2 stream cleanup ([#31](https://github.com/s2-streamstore/s2-sdk-python/issues/31)) ([f3527d6](https://github.com/s2-streamstore/s2-sdk-python/commit/f3527d6356e212adb26fd72d248b695c0efede7d))
43
-
44
-
45
- ### Documentation
46
-
47
- * add examples for centralized SDK docs ([#12](https://github.com/s2-streamstore/s2-sdk-python/issues/12)) ([9895ffb](https://github.com/s2-streamstore/s2-sdk-python/commit/9895ffb8da830c297ce1037b3a3743854cee6a59))
48
-
49
- ## [0.1.1](https://github.com/s2-streamstore/s2-sdk-python/compare/v0.1.0...v0.1.1) (2026-04-08)
50
-
51
-
52
- ### Bug Fixes
53
-
54
- * `producer.close()` orphans drain task on error ([#17](https://github.com/s2-streamstore/s2-sdk-python/issues/17)) ([e448d1d](https://github.com/s2-streamstore/s2-sdk-python/commit/e448d1d8885cd70581746db753d9a9344692d66b))
55
- * body gen hangs on retry when inputs exhausted in append session ([#13](https://github.com/s2-streamstore/s2-sdk-python/issues/13)) ([043be93](https://github.com/s2-streamstore/s2-sdk-python/commit/043be930772f007919d94ebb63c2544acad4c370))
56
- * linger resets on each record arrival in `append_record_batches` ([#14](https://github.com/s2-streamstore/s2-sdk-python/issues/14)) ([70ce203](https://github.com/s2-streamstore/s2-sdk-python/commit/70ce203556ff334a75cb788b3ca53d4dc2839de7))
57
-
58
- ## 0.1.0 (2026-04-07)
59
-
60
-
61
- ### Features
62
-
63
- * add initial version of `s2-sdk` ([#1](https://github.com/s2-streamstore/s2-sdk-python/issues/1)) ([3dc9795](https://github.com/s2-streamstore/s2-sdk-python/commit/3dc979596b10db0881dd3132165467a227ad79d3))
s2_sdk-0.2.2/CODEOWNERS DELETED
@@ -1 +0,0 @@
1
- * @s2-streamstore/dev
@@ -1,20 +0,0 @@
1
- # Minimal makefile for Sphinx documentation
2
- #
3
-
4
- # You can set these variables from the command line, and also
5
- # from the environment for the first two.
6
- SPHINXOPTS ?=
7
- SPHINXBUILD ?= uv run sphinx-build
8
- SOURCEDIR = source
9
- BUILDDIR = build
10
-
11
- # Put it first so that "make" without argument is like "make help".
12
- help:
13
- @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
-
15
- .PHONY: help Makefile
16
-
17
- # Catch-all target: route all unknown targets to Sphinx using the new
18
- # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
- %: Makefile
20
- @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)