Skip to main content

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

Metadata

Release files for rbm_tools 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rbm_tools 0.0.1
File Size Uploaded Provenance
rbm_tools-0.0.1.tar.gz 26.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for rbm_tools 0.0.1
File Interpreter ABI Platform
rbm_tools-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 61.6 kB

Release files / rbm_tools-0.0.1.tar.gz

Download URL rbm_tools-0.0.1.tar.gz
Size 26.1 kB
Tags Source
SHA-256 checksum
How to use checksums
31dfde4bf9820470fdf36b4f9d4d69c0533422ca0b93029892579554f1b3cac6
BLAKE2b-256 checksum
How to use checksums
d8d4895a53c34ed01b460e4210ff6d6a4e4787a71d54734c43bdf12411b9cede
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.12.3 Linux/6.17.0-1022-azure

Release files / rbm_tools-0.0.1-py3-none-any.whl

Download URL rbm_tools-0.0.1-py3-none-any.whl
Size 35.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9efce89a0c2f68b7fc173b18ad10998698ee5cbcbf87f26156d46aab6bca3353
BLAKE2b-256 checksum
How to use checksums
92d5cbd3535751885e532728e57edff2eedf283a22099453132142944dab454b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.12.3 Linux/6.17.0-1022-azure

Security for rbm_tools 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page