Metadata-Version: 2.4
Name: enlogging
Version: 0.1.2
Summary: enhance log
Author-email: tsinling <449598613@qq.com>
Requires-Python: >=3.10
Requires-Dist: loguru>=0.7.3
Requires-Dist: pydantic-settings>=2.12.0
Description-Content-Type: text/markdown

# README

## 初始化：Git + uv 项目
```shell
uv init my_package --package
cd my_package
git init
git add .
git commit -m "init project"
```

## 用 git tag 驱动版本号
### 修改 pyproject.toml（核心配置）
```toml
# 删除手写 version
[project]
name = "my-package"
dynamic = ["version"]

# 启用 hatch-vcs
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.hatch.version]
source = "vcs"
```

> 含义：
> + 版本号 来自 git tag
> + uv build / publish 时自动解析

### Git tag 规则（必须遵守）
```shell
git tag v0.1.0
```
支持：
+ v0.1.0
+ v1.2.3
+ v1.0.0rc1
+ v1.0.0.post1

### 本地验证版本号
```shell
uv build
```

## 完整 Git + uv 发布流程（标准）
```shell
# 1. 改代码
git checkout -b feature/x
git commit -m "add feature"

# 2. 合并到 main
git checkout main
git merge feature/x

# 3. 打 tag
git tag v0.2.0
git push origin main --tags

# 4. 发布
uv publish
```
