mainspring-session-postgres 0.1.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.
- mainspring_session_postgres-0.1.0/LICENSE +21 -0
- mainspring_session_postgres-0.1.0/PKG-INFO +73 -0
- mainspring_session_postgres-0.1.0/README.md +47 -0
- mainspring_session_postgres-0.1.0/mainspring_session_postgres/__init__.py +182 -0
- mainspring_session_postgres-0.1.0/mainspring_session_postgres/py.typed +0 -0
- mainspring_session_postgres-0.1.0/pyproject.toml +44 -0
- mainspring_session_postgres-0.1.0/pyproject.toml.orig +42 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 mainspring contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mainspring-session-postgres
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Postgres session store and run checkpoint for mainspring.
|
|
5
|
+
Author: mainspring contributors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Classifier: Typing :: Typed
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
18
|
+
Requires-Dist: mainspring-agent
|
|
19
|
+
Requires-Dist: asyncpg>=0.29,<1
|
|
20
|
+
Requires-Python: >=3.11
|
|
21
|
+
Project-URL: Homepage, https://github.com/chyong/mainspring
|
|
22
|
+
Project-URL: Documentation, https://github.com/chyong/mainspring/tree/main/docs
|
|
23
|
+
Project-URL: Repository, https://github.com/chyong/mainspring
|
|
24
|
+
Project-URL: Issues, https://github.com/chyong/mainspring/issues
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# mainspring-session-postgres
|
|
28
|
+
|
|
29
|
+
Postgres 会话后端 + RunCheckpoint 实现(T4-3)。实现 core 的两个 Protocol,与 SQLite 外挂共用
|
|
30
|
+
同一套接口契约测试(`tests/test_session_backends.py`),换后端只改 yaml。
|
|
31
|
+
|
|
32
|
+
## 用法
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
from mainspring_session_postgres import open_postgres, backend_factory
|
|
36
|
+
|
|
37
|
+
store, checkpoint = open_postgres(
|
|
38
|
+
"postgresql://mainspring:mainspring@127.0.0.1:5432/mainspring"
|
|
39
|
+
)
|
|
40
|
+
await store.append("s1", [Message(id="m1", role="user", content="你好")])
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
yaml 装配(core 不反向依赖外挂:工厂由调用方注入):
|
|
44
|
+
|
|
45
|
+
```yaml
|
|
46
|
+
session:
|
|
47
|
+
backend: postgres
|
|
48
|
+
url: postgresql://mainspring:mainspring@127.0.0.1:5432/mainspring
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
```python
|
|
52
|
+
runner = build_runner(config, backends={"postgres": backend_factory}, checkpoint=checkpoint)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`url` 缺省取 `MAINSPRING_SESSION_POSTGRES_DSN`,再缺省用 compose 默认 DSN。
|
|
56
|
+
|
|
57
|
+
## 设计要点
|
|
58
|
+
|
|
59
|
+
1. **幂等 append 靠唯一约束** `(session_id, message_id)` + `ON CONFLICT DO NOTHING`;
|
|
60
|
+
Postgres 唯一索引对 NULL 不去重,与 MemoryStore / SQLite「id=NULL 照写」语义一致。
|
|
61
|
+
2. **快照整包落表**:`INSERT ... ON CONFLICT (run_id) DO UPDATE`,并发写同一 run 由唯一约束
|
|
62
|
+
串行化,不会产生半截快照。
|
|
63
|
+
3. **条件写 `save_step_if`**:`UPDATE ... WHERE status = 期望值` 的 CAS,approve / deny 跨进程
|
|
64
|
+
竞态下只有一方成功(RunCheckpoint 契约之外的扩展能力,Redis / SQLite 同样提供)。
|
|
65
|
+
4. **表名带前缀** `ms_messages` / `ms_runs`,与同库其他业务表隔离。
|
|
66
|
+
5. **连接池懒初始化**:yaml 装配阶段不依赖 Postgres 在线;`aclose()` 关闭共享连接池。
|
|
67
|
+
|
|
68
|
+
## 验收
|
|
69
|
+
|
|
70
|
+
- `docker compose up -d postgres` 后跑 `pytest tests/test_session_backends.py -k postgres`;
|
|
71
|
+
- 覆盖:append 幂等 / NULL 不去重 / 会话隔离与删除 / 快照八要素 roundtrip / 覆盖写 /
|
|
72
|
+
并发双写 / 条件写单赢家;
|
|
73
|
+
- core 零反向依赖由 import-linter 守护。
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# mainspring-session-postgres
|
|
2
|
+
|
|
3
|
+
Postgres 会话后端 + RunCheckpoint 实现(T4-3)。实现 core 的两个 Protocol,与 SQLite 外挂共用
|
|
4
|
+
同一套接口契约测试(`tests/test_session_backends.py`),换后端只改 yaml。
|
|
5
|
+
|
|
6
|
+
## 用法
|
|
7
|
+
|
|
8
|
+
```python
|
|
9
|
+
from mainspring_session_postgres import open_postgres, backend_factory
|
|
10
|
+
|
|
11
|
+
store, checkpoint = open_postgres(
|
|
12
|
+
"postgresql://mainspring:mainspring@127.0.0.1:5432/mainspring"
|
|
13
|
+
)
|
|
14
|
+
await store.append("s1", [Message(id="m1", role="user", content="你好")])
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
yaml 装配(core 不反向依赖外挂:工厂由调用方注入):
|
|
18
|
+
|
|
19
|
+
```yaml
|
|
20
|
+
session:
|
|
21
|
+
backend: postgres
|
|
22
|
+
url: postgresql://mainspring:mainspring@127.0.0.1:5432/mainspring
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
runner = build_runner(config, backends={"postgres": backend_factory}, checkpoint=checkpoint)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`url` 缺省取 `MAINSPRING_SESSION_POSTGRES_DSN`,再缺省用 compose 默认 DSN。
|
|
30
|
+
|
|
31
|
+
## 设计要点
|
|
32
|
+
|
|
33
|
+
1. **幂等 append 靠唯一约束** `(session_id, message_id)` + `ON CONFLICT DO NOTHING`;
|
|
34
|
+
Postgres 唯一索引对 NULL 不去重,与 MemoryStore / SQLite「id=NULL 照写」语义一致。
|
|
35
|
+
2. **快照整包落表**:`INSERT ... ON CONFLICT (run_id) DO UPDATE`,并发写同一 run 由唯一约束
|
|
36
|
+
串行化,不会产生半截快照。
|
|
37
|
+
3. **条件写 `save_step_if`**:`UPDATE ... WHERE status = 期望值` 的 CAS,approve / deny 跨进程
|
|
38
|
+
竞态下只有一方成功(RunCheckpoint 契约之外的扩展能力,Redis / SQLite 同样提供)。
|
|
39
|
+
4. **表名带前缀** `ms_messages` / `ms_runs`,与同库其他业务表隔离。
|
|
40
|
+
5. **连接池懒初始化**:yaml 装配阶段不依赖 Postgres 在线;`aclose()` 关闭共享连接池。
|
|
41
|
+
|
|
42
|
+
## 验收
|
|
43
|
+
|
|
44
|
+
- `docker compose up -d postgres` 后跑 `pytest tests/test_session_backends.py -k postgres`;
|
|
45
|
+
- 覆盖:append 幂等 / NULL 不去重 / 会话隔离与删除 / 快照八要素 roundtrip / 覆盖写 /
|
|
46
|
+
并发双写 / 条件写单赢家;
|
|
47
|
+
- core 零反向依赖由 import-linter 守护。
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"""mainspring-session-postgres:Postgres 会话后端 + RunCheckpoint 实现(T4-3)。
|
|
2
|
+
|
|
3
|
+
与 SQLite 外挂共用同一套接口契约测试(tests/test_session_backends.py),接口不变(§2.6 / §2.9):
|
|
4
|
+
|
|
5
|
+
PostgresSessionStore SessionStore:load / append / delete
|
|
6
|
+
PostgresCheckpoint RunCheckpoint:load_run / save_step,快照整包存表
|
|
7
|
+
open_postgres(dsn) 便捷工厂:一次拿到同源的 store + checkpoint(§2.9 store 同源规则)
|
|
8
|
+
backend_factory 供 core.config 注入的后端工厂(session.backend: postgres)
|
|
9
|
+
|
|
10
|
+
设计要点:
|
|
11
|
+
|
|
12
|
+
- **幂等 append 靠唯一约束** `(session_id, message_id)` + `ON CONFLICT DO NOTHING`;
|
|
13
|
+
Postgres 唯一索引对 NULL 不去重,与 MemoryStore / SQLite「id=None 照写」语义一致(§2.9);
|
|
14
|
+
- **run 快照存单表**:`INSERT ... ON CONFLICT (run_id) DO UPDATE` 整包覆盖,多 worker 并发写
|
|
15
|
+
同一 run 由数据库唯一约束串行化,不会产生半截快照;
|
|
16
|
+
- **条件写 `save_step_if`**:`UPDATE ... WHERE status = 期望值` 带期望状态 CAS,用于 approve /
|
|
17
|
+
deny 跨进程竞态收口(T4-3 验收;RunCheckpoint 契约之外的扩展能力,Redis / SQLite 同样提供);
|
|
18
|
+
- **表名带前缀** `ms_messages` / `ms_runs`:与同库其他业务表隔离,免命名冲突;
|
|
19
|
+
- **连接池懒初始化**:`open_postgres` 只构造对象,首次读写才建池并建表——yaml 装配阶段不依赖
|
|
20
|
+
Postgres 在线;
|
|
21
|
+
- 后端不自带信号处理:停机快照由 Runner.shutdown() 统一驱动(§2.6)。
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
from __future__ import annotations
|
|
25
|
+
|
|
26
|
+
import asyncio
|
|
27
|
+
import os
|
|
28
|
+
from collections.abc import Sequence
|
|
29
|
+
|
|
30
|
+
import asyncpg
|
|
31
|
+
from mainspring.session import SessionStore
|
|
32
|
+
from mainspring.types import Message, RunSnapshot
|
|
33
|
+
|
|
34
|
+
__all__ = [
|
|
35
|
+
"DEFAULT_DSN",
|
|
36
|
+
"PostgresCheckpoint",
|
|
37
|
+
"PostgresSessionStore",
|
|
38
|
+
"backend_factory",
|
|
39
|
+
"open_postgres",
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
DEFAULT_DSN = "postgresql://mainspring:mainspring@127.0.0.1:5432/mainspring"
|
|
43
|
+
ENV_DSN = "MAINSPRING_SESSION_POSTGRES_DSN"
|
|
44
|
+
|
|
45
|
+
_SCHEMA = """
|
|
46
|
+
CREATE TABLE IF NOT EXISTS ms_messages (
|
|
47
|
+
seq BIGSERIAL PRIMARY KEY,
|
|
48
|
+
session_id TEXT NOT NULL,
|
|
49
|
+
message_id TEXT,
|
|
50
|
+
payload TEXT NOT NULL
|
|
51
|
+
);
|
|
52
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_ms_messages_dedupe
|
|
53
|
+
ON ms_messages (session_id, message_id);
|
|
54
|
+
CREATE INDEX IF NOT EXISTS idx_ms_messages_session
|
|
55
|
+
ON ms_messages (session_id, seq);
|
|
56
|
+
CREATE TABLE IF NOT EXISTS ms_runs (
|
|
57
|
+
run_id TEXT PRIMARY KEY,
|
|
58
|
+
status TEXT NOT NULL,
|
|
59
|
+
saved_at DOUBLE PRECISION NOT NULL,
|
|
60
|
+
payload TEXT NOT NULL
|
|
61
|
+
);
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class _Database:
|
|
66
|
+
"""最小异步 Postgres 封装:懒建连接池 + 首次建表(建表只做一次)。"""
|
|
67
|
+
|
|
68
|
+
def __init__(self, dsn: str) -> None:
|
|
69
|
+
self.dsn = dsn
|
|
70
|
+
self._pool: asyncpg.Pool | None = None
|
|
71
|
+
self._lock = asyncio.Lock()
|
|
72
|
+
|
|
73
|
+
async def pool(self) -> asyncpg.Pool:
|
|
74
|
+
# 双重检查 + 锁:并发首次访问只建一次池、只跑一次建表
|
|
75
|
+
if self._pool is None:
|
|
76
|
+
async with self._lock:
|
|
77
|
+
if self._pool is None:
|
|
78
|
+
pool = await asyncpg.create_pool(self.dsn, min_size=1, max_size=10)
|
|
79
|
+
async with pool.acquire() as connection:
|
|
80
|
+
await connection.execute(_SCHEMA)
|
|
81
|
+
self._pool = pool
|
|
82
|
+
return self._pool
|
|
83
|
+
|
|
84
|
+
async def aclose(self) -> None:
|
|
85
|
+
if self._pool is not None:
|
|
86
|
+
await self._pool.close()
|
|
87
|
+
self._pool = None
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
class PostgresSessionStore:
|
|
91
|
+
"""SessionStore 的 Postgres 实现:append 由唯一索引 + ON CONFLICT 幂等去重。"""
|
|
92
|
+
|
|
93
|
+
def __init__(self, database: _Database) -> None:
|
|
94
|
+
self._db = database
|
|
95
|
+
|
|
96
|
+
async def load(self, session_id: str) -> list[Message]:
|
|
97
|
+
pool = await self._db.pool()
|
|
98
|
+
rows = await pool.fetch(
|
|
99
|
+
"SELECT payload FROM ms_messages WHERE session_id = $1 ORDER BY seq",
|
|
100
|
+
session_id,
|
|
101
|
+
)
|
|
102
|
+
return [Message.model_validate_json(row["payload"]) for row in rows]
|
|
103
|
+
|
|
104
|
+
async def append(self, session_id: str, messages: Sequence[Message]) -> None:
|
|
105
|
+
if not messages:
|
|
106
|
+
return
|
|
107
|
+
pool = await self._db.pool()
|
|
108
|
+
# 整批一个事务:要么全部入库要么全部回滚,配合 ON CONFLICT 幂等,失败重试整批安全
|
|
109
|
+
async with pool.acquire() as connection, connection.transaction():
|
|
110
|
+
for message in messages:
|
|
111
|
+
await connection.execute(
|
|
112
|
+
"INSERT INTO ms_messages (session_id, message_id, payload) "
|
|
113
|
+
"VALUES ($1, $2, $3) ON CONFLICT DO NOTHING",
|
|
114
|
+
session_id,
|
|
115
|
+
message.id,
|
|
116
|
+
message.model_dump_json(),
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
async def delete(self, session_id: str) -> None:
|
|
120
|
+
pool = await self._db.pool()
|
|
121
|
+
await pool.execute("DELETE FROM ms_messages WHERE session_id = $1", session_id)
|
|
122
|
+
|
|
123
|
+
async def aclose(self) -> None:
|
|
124
|
+
await self._db.aclose()
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
class PostgresCheckpoint:
|
|
128
|
+
"""RunCheckpoint 的 Postgres 实现:快照整包落表,支持带期望状态的条件写。"""
|
|
129
|
+
|
|
130
|
+
def __init__(self, database: _Database) -> None:
|
|
131
|
+
self._db = database
|
|
132
|
+
|
|
133
|
+
async def load_run(self, run_id: str) -> RunSnapshot | None:
|
|
134
|
+
pool = await self._db.pool()
|
|
135
|
+
row = await pool.fetchrow("SELECT payload FROM ms_runs WHERE run_id = $1", run_id)
|
|
136
|
+
return None if row is None else RunSnapshot.model_validate_json(row["payload"])
|
|
137
|
+
|
|
138
|
+
async def save_step(self, run_id: str, step: RunSnapshot) -> None:
|
|
139
|
+
"""整包覆盖写(INSERT ... ON CONFLICT):后写者胜;并发写同一 run 由主键串行化,
|
|
140
|
+
不会产生半截快照。跨进程竞态收口用 save_step_if 的 CAS。
|
|
141
|
+
"""
|
|
142
|
+
pool = await self._db.pool()
|
|
143
|
+
await pool.execute(
|
|
144
|
+
"INSERT INTO ms_runs (run_id, status, saved_at, payload) "
|
|
145
|
+
"VALUES ($1, $2, $3, $4) "
|
|
146
|
+
"ON CONFLICT (run_id) DO UPDATE SET "
|
|
147
|
+
"status = excluded.status, saved_at = excluded.saved_at, payload = excluded.payload",
|
|
148
|
+
run_id,
|
|
149
|
+
step.status,
|
|
150
|
+
step.saved_at,
|
|
151
|
+
step.model_dump_json(),
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
async def save_step_if(self, run_id: str, step: RunSnapshot, *, expected_status: str) -> bool:
|
|
155
|
+
"""条件写(CAS):仅当已存的 status 等于 expected_status 时覆盖,返回是否写入。"""
|
|
156
|
+
pool = await self._db.pool()
|
|
157
|
+
applied = await pool.fetchval(
|
|
158
|
+
"UPDATE ms_runs SET status = $2, saved_at = $3, payload = $4 "
|
|
159
|
+
"WHERE run_id = $1 AND status = $5 RETURNING run_id",
|
|
160
|
+
run_id,
|
|
161
|
+
step.status,
|
|
162
|
+
step.saved_at,
|
|
163
|
+
step.model_dump_json(),
|
|
164
|
+
expected_status,
|
|
165
|
+
)
|
|
166
|
+
return applied is not None
|
|
167
|
+
|
|
168
|
+
async def aclose(self) -> None:
|
|
169
|
+
await self._db.aclose()
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
def open_postgres(dsn: str | None = None) -> tuple[PostgresSessionStore, PostgresCheckpoint]:
|
|
173
|
+
"""同源工厂:store 与 checkpoint 共享一个连接池(§2.9 store 同源规则)。"""
|
|
174
|
+
database = _Database(dsn or DEFAULT_DSN)
|
|
175
|
+
return PostgresSessionStore(database), PostgresCheckpoint(database)
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
def backend_factory(config: object) -> SessionStore:
|
|
179
|
+
"""供 core.config 注入的后端工厂:读 session.url,缺省取环境变量或 compose 默认 DSN。"""
|
|
180
|
+
dsn = getattr(config, "url", None) or os.environ.get(ENV_DSN) or DEFAULT_DSN
|
|
181
|
+
store, _ = open_postgres(dsn)
|
|
182
|
+
return store
|
|
File without changes
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "mainspring-session-postgres"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Postgres session store and run checkpoint for mainspring."
|
|
5
|
+
license = "MIT"
|
|
6
|
+
license-files = ["LICENSE"]
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
classifiers = [
|
|
9
|
+
"Development Status :: 4 - Beta",
|
|
10
|
+
"Intended Audience :: Developers",
|
|
11
|
+
"Operating System :: OS Independent",
|
|
12
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
13
|
+
"Programming Language :: Python :: 3.11",
|
|
14
|
+
"Programming Language :: Python :: 3.12",
|
|
15
|
+
"Programming Language :: Python :: 3.13",
|
|
16
|
+
"Programming Language :: Python :: 3.14",
|
|
17
|
+
"Typing :: Typed",
|
|
18
|
+
"Topic :: Software Development :: Libraries :: Application Frameworks",
|
|
19
|
+
]
|
|
20
|
+
requires-python = ">=3.11"
|
|
21
|
+
dependencies = [
|
|
22
|
+
"mainspring-agent",
|
|
23
|
+
"asyncpg>=0.29,<1",
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
[[project.authors]]
|
|
27
|
+
name = "mainspring contributors"
|
|
28
|
+
|
|
29
|
+
[project.urls]
|
|
30
|
+
Homepage = "https://github.com/chyong/mainspring"
|
|
31
|
+
Documentation = "https://github.com/chyong/mainspring/tree/main/docs"
|
|
32
|
+
Repository = "https://github.com/chyong/mainspring"
|
|
33
|
+
Issues = "https://github.com/chyong/mainspring/issues"
|
|
34
|
+
|
|
35
|
+
[tool.uv.sources.mainspring-agent]
|
|
36
|
+
workspace = true
|
|
37
|
+
|
|
38
|
+
[tool.uv.build-backend]
|
|
39
|
+
module-name = "mainspring_session_postgres"
|
|
40
|
+
module-root = ""
|
|
41
|
+
|
|
42
|
+
[build-system]
|
|
43
|
+
requires = ["uv_build>=0.8,<2"]
|
|
44
|
+
build-backend = "uv_build"
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "mainspring-session-postgres"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Postgres session store and run checkpoint for mainspring."
|
|
5
|
+
license = "MIT"
|
|
6
|
+
license-files = ["LICENSE"]
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
authors = [{ name = "mainspring contributors" }]
|
|
9
|
+
classifiers = [
|
|
10
|
+
"Development Status :: 4 - Beta",
|
|
11
|
+
"Intended Audience :: Developers",
|
|
12
|
+
"Operating System :: OS Independent",
|
|
13
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
14
|
+
"Programming Language :: Python :: 3.11",
|
|
15
|
+
"Programming Language :: Python :: 3.12",
|
|
16
|
+
"Programming Language :: Python :: 3.13",
|
|
17
|
+
"Programming Language :: Python :: 3.14",
|
|
18
|
+
"Typing :: Typed",
|
|
19
|
+
"Topic :: Software Development :: Libraries :: Application Frameworks",
|
|
20
|
+
]
|
|
21
|
+
requires-python = ">=3.11"
|
|
22
|
+
dependencies = [
|
|
23
|
+
"mainspring-agent",
|
|
24
|
+
"asyncpg>=0.29,<1",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
[project.urls]
|
|
28
|
+
Homepage = "https://github.com/chyong/mainspring"
|
|
29
|
+
Documentation = "https://github.com/chyong/mainspring/tree/main/docs"
|
|
30
|
+
Repository = "https://github.com/chyong/mainspring"
|
|
31
|
+
Issues = "https://github.com/chyong/mainspring/issues"
|
|
32
|
+
|
|
33
|
+
[tool.uv.sources]
|
|
34
|
+
mainspring-agent = { workspace = true }
|
|
35
|
+
|
|
36
|
+
[build-system]
|
|
37
|
+
requires = ["uv_build>=0.8,<2"]
|
|
38
|
+
build-backend = "uv_build"
|
|
39
|
+
|
|
40
|
+
[tool.uv.build-backend]
|
|
41
|
+
module-name = "mainspring_session_postgres"
|
|
42
|
+
module-root = ""
|