Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

Commit 4371c6e

Browse files
committed
wip
1 parent 2bef575 commit 4371c6e

61 files changed

Lines changed: 9267 additions & 4587 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 79 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,39 @@
11
name: CI
2-
on:
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.3"
6+
7+
on:
38
pull_request:
4-
types: [opened, edited, synchronize, labeled, unlabeled, ready_for_review, reopened]
9+
types:
10+
[
11+
opened,
12+
edited,
13+
synchronize,
14+
labeled,
15+
unlabeled,
16+
ready_for_review,
17+
reopened,
18+
]
519
jobs:
6-
ci:
7-
name: CI
20+
local-checks:
21+
name: Local Checks (code quality, unit tests, docs build, PR title)
822
runs-on: ubuntu-latest
923
steps:
1024
- name: Checkout repository
1125
uses: actions/checkout@v4
1226
- name: Install uv
13-
uses: astral-sh/setup-uv@v6
27+
uses: astral-sh/setup-uv@v7
1428
with:
15-
version: "0.8.2"
29+
version: ${{ env.UV_VERSION }}
1630
- name: Sync dependencies
1731
run: |
1832
uv sync --all-groups
1933
- name: Static code check
2034
run: uv run poe ci_checker
35+
- name: Unit tests
36+
run: uv run pytest tests/ -v -m 'not (account or basin or stream or metrics)'
2137
- name: Check docs build
2238
working-directory: ./docs
2339
run: |
@@ -26,20 +42,61 @@ jobs:
2642
uses: actions/github-script@v7
2743
with:
2844
script: |
29-
const title = context.payload.pull_request.title;
30-
const labels = context.payload.pull_request.labels.map(l => l.name);
31-
if (labels.includes('dev')) {
32-
const regex = /^(?!feat|fix|refactor|docs|perf|style|test|chore|revert)[a-z].*$/;
33-
if (!regex.test(title)) {
34-
core.setFailed(
35-
`PR title "${title}" does not match the commit format for non-user-facing changes`
36-
);
37-
}
38-
} else {
39-
const regex = /^(feat|fix|refactor|docs|perf|style|test|chore|revert)!?:[ ][a-z].*$/;
40-
if (!regex.test(title)) {
41-
core.setFailed(
42-
`PR title "${title}" does not match the expected conventional commit format for user-facing changes`
43-
);
44-
}
45+
const title = context.payload.pull_request.title;
46+
const labels = context.payload.pull_request.labels.map(l => l.name);
47+
if (labels.includes('dev')) {
48+
const regex = /^(?!feat|fix|refactor|docs|perf|style|test|chore|revert)[a-z].*$/;
49+
if (!regex.test(title)) {
50+
core.setFailed(
51+
`PR title "${title}" does not match the commit format for non-user-facing changes`
52+
);
4553
}
54+
} else {
55+
const regex = /^(feat|fix|refactor|docs|perf|style|test|chore|revert)!?:[ ][a-z].*$/;
56+
if (!regex.test(title)) {
57+
core.setFailed(
58+
`PR title "${title}" does not match the expected conventional commit format for user-facing changes`
59+
);
60+
}
61+
}
62+
63+
s2-cloud-integration-tests:
64+
name: s2-cloud integration tests
65+
runs-on: ubuntu-latest
66+
steps:
67+
- name: Checkout repository
68+
uses: actions/checkout@v4
69+
- name: Install uv
70+
uses: astral-sh/setup-uv@v7
71+
with:
72+
version: ${{ env.UV_VERSION }}
73+
- name: Sync dependencies
74+
run: uv sync --group test
75+
- name: Run integration tests
76+
env:
77+
S2_ACCESS_TOKEN: ${{ secrets.S2_ACCESS_TOKEN }}
78+
run: uv run pytest tests/ -v -s -m 'account or basin or stream or metrics'
79+
80+
build-s2-lite:
81+
name: Build s2-lite
82+
uses: s2-streamstore/s2/.github/workflows/build-s2-lite.yml@main
83+
84+
s2-lite-integration-tests:
85+
name: s2-lite integration tests
86+
needs: build-s2-lite
87+
uses: s2-streamstore/s2/.github/workflows/sdk-tests.yml@main
88+
with:
89+
server-binary: server
90+
server-args: "--port 8080"
91+
server-port: 8080
92+
sdks: |
93+
[
94+
{
95+
"name": "python",
96+
"repo": "${{ github.repository }}",
97+
"ref": "${{ github.ref }}",
98+
"lang": "python",
99+
"uv-version": "0.11.3",
100+
"test_cmd": "uv run pytest tests/ -v -s -m '(account or basin or stream) and not cloud_only'"
101+
}
102+
]

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release streamstore package
1+
name: Release s2-sdk package
22
on:
33
push:
44
tags: ["[0-9]+.[0-9]+.[0-9]+*"]

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
# streamstore
1+
# s2-sdk
22
<div>
33
<p>
44
<!-- PyPI -->
5-
<a href="https://pypi.org/project/streamstore/"><img src="https://img.shields.io/pypi/v/streamstore" /></a>
5+
<a href="https://pypi.org/project/s2-sdk/"><img src="https://img.shields.io/pypi/v/s2-sdk" /></a>
66
<!-- Read the docs -->
7-
<a href="https://streamstore.readthedocs.io/"><img src="https://img.shields.io/readthedocs/streamstore/latest" /></a>
7+
<a href="https://s2-sdk.readthedocs.io/"><img src="https://img.shields.io/readthedocs/s2-sdk/latest" /></a>
88
<!-- Discord -->
99
<a href="https://discord.gg/vTCs7kMkAf"><img src="https://img.shields.io/discord/1209937852528599092?logo=discord" /></a>
1010
<!-- LICENSE -->
1111
<a href="https://github.com/s2-streamstore/s2-sdk-python/blob/main/LICENSE"><img src="https://img.shields.io/github/license/s2-streamstore/s2-sdk-python" /></a>
1212
</p>
1313
</div>
1414

15-
`streamstore` is the Python package that provides an async client for interacting with [s2.dev](https://s2.dev/).
15+
`s2_sdk` is the Python package that provides an async client for interacting with [s2.dev](https://s2.dev/).
1616

1717
## Project links
1818

19-
- [PyPI](https://pypi.org/project/streamstore/)
20-
- [Documentation](https://streamstore.readthedocs.io/)
19+
- [PyPI](https://pypi.org/project/s2-sdk/)
20+
- [Documentation](https://s2-sdk.readthedocs.io/)
2121
- [GitHub](https://github.com/s2-streamstore/s2-sdk-python)
2222

2323
## Requirements
@@ -26,10 +26,10 @@ Python >= 3.11
2626

2727
## Installation
2828

29-
You can install the package from the [Python Package Index](https://pypi.org/project/streamstore) using the package manager of your choice. E.g., with `pip`:
29+
You can install the package from the [Python Package Index](https://pypi.org/project/s2-sdk) using the package manager of your choice. E.g., with `pip`:
3030

3131
```bash
32-
pip install streamstore
32+
pip install s2-sdk
3333
```
3434

3535
## Examples

docs/source/api-reference.md

Lines changed: 164 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,183 @@
11
# API Reference
22

33
```{eval-rst}
4-
.. module:: streamstore
4+
.. module:: s2_sdk
55
66
.. autoclass:: S2
77
:members:
8-
:member-order: bysource
98
10-
.. autoclass:: Basin()
9+
10+
.. autoclass:: S2Basin()
11+
:members:
12+
13+
14+
.. autoclass:: S2Stream()
15+
:members:
16+
17+
18+
.. autoclass:: AppendSession()
19+
:members:
20+
21+
22+
.. autoclass:: BatchSubmitTicket()
23+
:members:
24+
25+
.. autoclass:: Producer()
26+
:members:
27+
28+
29+
.. autoclass:: RecordSubmitTicket()
30+
:members:
31+
32+
.. autoclass:: Endpoints
33+
:members:
34+
35+
36+
.. autoclass:: Timeout(request: timedelta = timedelta(seconds=5), connection: timedelta = timedelta(seconds=3))
37+
:members:
38+
39+
.. autoclass:: Retry(max_attempts: int = 3, min_base_delay: timedelta = timedelta(milliseconds=100), max_base_delay: timedelta = timedelta(seconds=1), append_retry_policy: AppendRetryPolicy = AppendRetryPolicy.ALL)
40+
:members:
41+
42+
.. autoclass:: Batching(max_records: int = 1000, max_bytes: int = 1048576, linger: timedelta = timedelta(milliseconds=5))
43+
:members:
44+
45+
.. autoclass:: Record(body: bytes, headers: list[tuple[bytes, bytes]] = [], timestamp: int | None = None)
46+
:members:
47+
48+
.. autoclass:: AppendInput
49+
:members:
50+
51+
.. autoclass:: AppendAck()
52+
:members:
53+
54+
.. autoclass:: IndexedAppendAck()
55+
:members:
56+
57+
.. autoclass:: StreamPosition()
58+
:members:
59+
60+
.. autoclass:: ReadLimit
61+
:members:
62+
63+
.. autoclass:: ReadBatch()
64+
:members:
65+
66+
.. autoclass:: SequencedRecord()
67+
:members:
68+
69+
.. autoclass:: SeqNum
70+
:members:
71+
72+
.. autoclass:: Timestamp
73+
:members:
74+
75+
.. autoclass:: TailOffset
76+
:members:
77+
78+
.. autoclass:: Page()
79+
:members:
80+
81+
.. autoclass:: CommandRecord()
82+
:members:
83+
84+
85+
.. autofunction:: metered_bytes
86+
87+
.. autofunction:: append_record_batches
88+
89+
.. autofunction:: append_inputs
90+
91+
.. autoenum:: Compression
92+
93+
.. autoenum:: AppendRetryPolicy
94+
95+
.. autoenum:: StorageClass
96+
97+
.. autoenum:: TimestampingMode
98+
99+
.. autoclass:: Timestamping
100+
:members:
101+
102+
.. autoclass:: StreamConfig
103+
:members:
104+
105+
.. autoclass:: BasinConfig
106+
:members:
107+
108+
.. autoenum:: BasinScope
109+
110+
.. autoclass:: BasinInfo()
111+
:members:
112+
113+
.. autoclass:: StreamInfo()
114+
:members:
115+
116+
.. autoclass:: ExactMatch
117+
:members:
118+
119+
.. autoclass:: PrefixMatch
120+
:members:
121+
122+
.. autoenum:: Permission
123+
124+
.. autoenum:: Operation
125+
126+
.. autoclass:: OperationGroupPermissions
127+
:members:
128+
129+
.. autoclass:: AccessTokenScope(basins: ExactMatch | PrefixMatch | None = None, streams: ExactMatch | PrefixMatch | None = None, access_tokens: ExactMatch | PrefixMatch | None = None, op_groups: OperationGroupPermissions | None = None, ops: list[Operation] = [])
130+
:members:
131+
132+
.. autoclass:: AccessTokenInfo()
133+
:members:
134+
135+
.. autoenum:: MetricUnit
136+
137+
.. autoenum:: TimeseriesInterval
138+
139+
.. autoenum:: AccountMetricSet
140+
141+
.. autoenum:: BasinMetricSet
142+
143+
.. autoenum:: StreamMetricSet
144+
145+
.. autoclass:: Scalar()
146+
:members:
147+
148+
.. autoclass:: Accumulation()
149+
:members:
150+
151+
.. autoclass:: Gauge()
152+
:members:
153+
154+
.. autoclass:: Label()
155+
:members:
156+
157+
.. autoclass:: S2Error()
158+
:members:
159+
160+
.. autoclass:: S2ClientError()
11161
:members:
12-
:member-order: bysource
162+
:show-inheritance:
13163
14-
.. autoclass:: Stream()
164+
.. autoclass:: S2ServerError()
15165
:members:
16-
:member-order: bysource
166+
:show-inheritance:
17167
18-
.. module:: streamstore.schemas
19-
:no-index:
20-
.. autoclass:: Record(body: bytes, headers: list[tuple[bytes, bytes]] = [])
168+
.. autoclass:: AppendConditionError()
21169
:members:
170+
:show-inheritance:
22171
23-
.. automodule:: streamstore.schemas
172+
.. autoclass:: FencingTokenMismatchError()
24173
:members:
25-
:exclude-members: Record, Endpoints
26-
:member-order: bysource
174+
:show-inheritance:
27175
28-
.. module:: streamstore.schemas
29-
:no-index:
30-
.. autoclass:: Endpoints()
176+
.. autoclass:: SeqNumMismatchError()
31177
:members:
178+
:show-inheritance:
32179
33-
.. automodule:: streamstore.utils
180+
.. autoclass:: ReadUnwrittenError()
34181
:members:
35-
:member-order: bysource
182+
:show-inheritance:
36183
```

docs/source/conf.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
from datetime import date
1010

11-
project = "streamstore"
11+
project = "s2-sdk"
1212
copyright = f"{date.today().year}, Bandar Systems Inc"
13-
release = "5.0.0"
13+
release = "0.1.0"
1414

1515
# -- General configuration ---------------------------------------------------
1616
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
@@ -28,6 +28,11 @@
2828
templates_path = ["_templates"]
2929
exclude_patterns = []
3030

31+
32+
autodoc_member_order = "bysource"
33+
autodoc_typehints_format = "short"
34+
python_use_unqualified_type_names = True
35+
3136
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}
3237

3338
# -- Options for HTML output -------------------------------------------------

0 commit comments

Comments
 (0)