Metadata-Version: 2.4
Name: rbm_tools
Version: 0.0.1
Summary: 
License: MIT
License-File: LICENSE
Requires-Python: >=3.13,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: aiomysql (>=0.3.2,<0.4.0)
Requires-Dist: autoflake (==2.4.0)
Requires-Dist: black (==26.5.1)
Requires-Dist: click (>=8.5.0,<9.0.0)
Requires-Dist: fastapi (>=0.141.1,<0.142.0)
Requires-Dist: func_timeout (>=4.3.5,<5.0.0)
Requires-Dist: gunicorn (>=26.2.0,<27.0.0)
Requires-Dist: httpx (>=0.28.1,<0.29.0)
Requires-Dist: isort (==9.0.1)
Requires-Dist: libcst (==1.8.6)
Requires-Dist: openai (>=3.13.0,<4.0.0)
Requires-Dist: opentelemetry-exporter-otlp-proto-http (>=1.44.0,<2.0.0)
Requires-Dist: opentelemetry-instrumentation-fastapi (>=0.65b0,<0.66)
Requires-Dist: opentelemetry-instrumentation-logging (>=0.65b0,<0.66)
Requires-Dist: opentelemetry-instrumentation-openai (>=0.62.3,<0.63.0)
Requires-Dist: pre-commit (>=4.6.2,<5.0.0)
Requires-Dist: prometheus-fastapi-instrumentator (>=8.1.0,<9.0.0)
Requires-Dist: pydantic (>=2.13.5,<3.0.0)
Requires-Dist: pydantic-settings (>=2.15.0,<3.0.0)
Requires-Dist: pymysql (>=1.2.3,<2.0.0)
Requires-Dist: redis (>=8.1.0,<9.0.0)
Requires-Dist: setuptools (==78.1.1)
Requires-Dist: sqlalchemy (>=2.0.54,<3.0.0)
Requires-Dist: sqlmodel (>=0.0.42,<0.0.43)
Requires-Dist: starlette-context (>=0.5.1,<0.6.0)
Requires-Dist: starlette_exporter (>=0.24.0,<0.25.0)
Requires-Dist: uvicorn (>=0.53.0,<0.54.0)
Description-Content-Type: text/markdown

## 1. 开发环境 Get Started
### 1.1 使用 Anaconda 安装 python 3.13

```
conda remove -n py313 --all
conda create -n py313 python=3.13
source activate py313
```

### 1.2 安装 VS Code 插件

详见文件 .vscode/extensions.json 中的 recommendations 配置

### 1.3 设置 VS Code

详见文件 .vscode/setting.json

### 1.4 依赖管理 poetry

```
python -m pip install poetry==2.4.1
poetry install
```

### 1.5 pre-commit

```
# Execute below command at root directory to install git hooks into your `.git/` directory.
pre-commit install --config ./.pre-commit-config.yaml
```


## 2. 代码风格
### 规则

- 必须按照该文档的 `开发环境 Get Started` 准备好开发环境
- VS Code 飘红提示必须解决，遇到 python 语言特性导致的飘红可以使用 `# type: ignore` 或 `# pylint: disable=W0212` 忽略
- 函数的出入参必须要有类型声明
- 写注释时，字母和汉字之间需要有一个空格


## 其他
### poetry 的注意事项

其他可能会用到的命令

```
# 增加依赖
poetry add {依赖名}
 
# 安装依赖
poetry install

# 更新依赖
poetry update {依赖名}

# 删除依赖
poetry remove {依赖名}

# 环境信息
poetry env info

# 展示依赖版本
poetry show -t
```

如果 poetry.lock 文件冲突，应该删除 `rm poetry.lock` 并使用 `poetry update` 重新生成 poetry.lock 文件

### sdk 开发和发版

```
# 开发 sdk 时为了解决 python 项目的路径问题，需要运行下面这个命令（**千万注意修改的代码是不是该项目中的代码**）
cd ..
pip install -e ./rbm_tools

# sdk 发版
cd ./rbm_tools
vi pyproject.toml # 修改 sdk pyproject.toml 的 version
./build.sh

# 修改项目中使用的 sdk 版本
vi pyproject.toml # 修改 pyproject.toml sdk 的 version
rm poetry.lock
poetry update
```

