Document git-source install and tag-driven release flow

Project is distributed from git + tags rather than PyPI. Replace the
sync/wheel install instructions with `uv add 'git+URL@tag'` forms and
add a release section spelling out the manual version-bump + tag
procedure.
This commit is contained in:
2026-05-12 00:44:02 +08:00
parent c8fa5db7d3
commit 95a5f8b2ed

View File

@@ -20,20 +20,29 @@
## 安装 ## 安装
使用 [uv](https://docs.astral.sh/uv/) 管理: 本项目不发布到 PyPI始终通过 git 源码 + tag 管理。要求 Python ≥ 3.12。
**在你自己的项目里引用**(用 [uv](https://docs.astral.sh/uv/)
```bash ```bash
uv sync # 指定 tag推荐
uv add 'git+https://git.vercanti.com/yellowdog/mouse_control.git@v0.1.0'
# 跟随 main
uv add 'git+https://git.vercanti.com/yellowdog/mouse_control.git'
# 指定 commit
uv add 'git+https://git.vercanti.com/yellowdog/mouse_control.git@<sha>'
``` ```
或从构建产物安装 **本仓库内开发**
```bash ```bash
uv pip install dist/mouse_control-0.1.0-py3-none-any.whl uv sync # 安装依赖(含 dev 组的 pytest
uv run pytest # 跑测试
uv build # 产出 wheel + sdist
``` ```
要求 Python ≥ 3.12。
## 项目结构 ## 项目结构
``` ```
@@ -137,7 +146,7 @@ cv::Mat output = net.forward("output"); // 输出 1*10*2
std::cout << output.at<float>(0, 8, 0) << std::endl; std::cout << output.at<float>(0, 8, 0) << std::endl;
``` ```
## 打包发布 ## 打包
```bash ```bash
uv build uv build
@@ -146,3 +155,21 @@ uv build
``` ```
wheel 内含 `assets/mouse.onnx` 预训练模型,安装后直接 `mc.load_model()` 即可使用。 wheel 内含 `assets/mouse.onnx` 预训练模型,安装后直接 `mc.load_model()` 即可使用。
## 发版tag 驱动)
`pyproject.toml` 里的 `version` 字段是手动维护的,必须和 git tag 保持同步。
发版步骤:
```bash
# 1. 改版本号
$EDITOR pyproject.toml # version = "0.2.0"
# 2. 提交并打 tag
git add pyproject.toml
git commit -m "Release v0.2.0"
git tag v0.2.0
git push && git push --tags
```
下游再 `uv add 'git+...@v0.2.0'` 就拿到对应版本。