Metadata-Version: 2.4
Name: example_package_yzqq
Version: 0.1.0
Summary: A simple Python package demonstrating uv packaging
Project-URL: Homepage, https://github.com/yourusername/simple-package
Project-URL: Documentation, https://github.com/yourusername/simple-package
Project-URL: Repository, https://github.com/yourusername/simple-package.git
Project-URL: Bug Tracker, https://github.com/yourusername/simple-package/issues
Author-email: Your Name <your.email@example.com>
License: MIT
License-File: LICENSE
Keywords: demo,packaging,uv
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Requires-Dist: click>=8.0.0
Requires-Dist: requests>=2.25.0
Provides-Extra: dev
Requires-Dist: black>=21.0; extra == 'dev'
Requires-Dist: flake8>=3.8; extra == 'dev'
Requires-Dist: mypy>=0.800; extra == 'dev'
Requires-Dist: pytest>=6.0; extra == 'dev'
Provides-Extra: test
Requires-Dist: pytest-cov>=2.0; extra == 'test'
Requires-Dist: pytest>=6.0; extra == 'test'
Description-Content-Type: text/markdown

# Simple Package

一个用于演示 uv 打包过程的简单 Python 包。

## 功能特性

- 简单的计算器类，支持基本数学运算
- 实用工具函数（字符串处理、邮箱验证等）
- 命令行接口 (CLI)
- 完整的测试套件
- 使用现代 Python 打包工具 (pyproject.toml + uv)

## 安装

### 使用 uv 安装（推荐）

```bash
# 从本地目录安装
uv pip install .

# 开发模式安装
uv pip install -e .

# 安装开发依赖
uv pip install -e ".[dev]"
```

### 使用 pip 安装

```bash
# 从本地目录安装
pip install .

# 开发模式安装
pip install -e .
```

## 使用方法

### 作为 Python 库

```python
from simple_package import Calculator, greet, format_number

# 使用计算器
calc = Calculator()
result = calc.add(5, 3)
print(f"5 + 3 = {result}")

# 查看历史记录
history = calc.get_history()
print("计算历史:", history)

# 使用其他函数
greeting = greet("Alice")
print(greeting)  # Hello, Alice!

formatted = format_number(3.14159, 2)
print(formatted)  # 3.14
```

### 使用命令行接口

```bash
# 问候
simple-cli hello --name Alice

# 计算
simple-cli calc 5 3 --operation add
simple-cli calc 10 2 --operation divide

# 查看帮助
simple-cli --help
```

## 开发

### 设置开发环境

```bash
# 克隆或进入项目目录
cd simple_uv_project

# 使用 uv 创建虚拟环境并安装依赖
uv venv
source .venv/bin/activate  # Linux/Mac
# 或 .venv\Scripts\activate  # Windows

# 安装项目及开发依赖
uv pip install -e ".[dev]"
```

### 运行测试

```bash
# 运行所有测试
pytest

# 运行测试并查看覆盖率
pytest --cov=simple_package
```

### 代码格式化

```bash
# 格式化代码
black src/ tests/

# 检查代码风格
flake8 src/ tests/

# 类型检查
mypy src/
```

## 项目结构

```
simple_uv_project/
├── src/
│   └── simple_package/
│       ├── __init__.py
│       ├── core.py          # 核心功能
│       ├── utils.py         # 实用工具
│       └── cli.py           # 命令行接口
├── tests/
│   ├── __init__.py
│   ├── test_core.py
│   └── test_utils.py
├── pyproject.toml           # 项目配置
├── README.md
└── LICENSE
```

## 使用 uv 进行打包

### 构建包

```bash
# 确保在项目根目录
cd /home/yz/learn_llm/simple_uv_project

# 使用 uv 构建
uv build

# 或者使用 build 工具
python -m build
```

这将在 `dist/` 目录中生成：
- `simple_package-0.1.0.tar.gz` (源代码分发包)
- `simple_package-0.1.0-py3-none-any.whl` (wheel 包)

### 发布到 PyPI

```bash
# 安装 twine
uv pip install twine

# 发布到 TestPyPI
twine upload --repository testpypi dist/*

# 发布到 PyPI
twine upload dist/*
```

## 许可证

MIT License

## 贡献

欢迎提交 Issue 和 Pull Request！