跳到内容

贡献到 Lance-Ray

感谢您对贡献到 Lance-Ray 的兴趣!本文档提供了贡献到该项目的指南和说明。

先决条件

  • Python >= 3.10
  • UV 包管理器
  • Git

设置您的开发环境

  1. Fork 并克隆仓库
# Fork the repository on GitHub, then clone your fork
git clone https://github.com/YOUR_USERNAME/lance-ray.git
cd lance-ray
  1. 安装 UV(如果尚未安装)
pip install uv
  1. 以开发模式安装项目
# Install with all development dependencies
uv pip install -e ".[dev]"

# To work on documentation, also install docs dependencies
uv pip install -e ".[dev,docs]"

运行测试

运行测试套件以确保一切正常

# Run all tests
uv run pytest

# Run with coverage report
uv run pytest --cov=lance_ray

# Run specific test file
uv run pytest tests/test_basic_read_write.py -vv

检查代码风格

我们使用 ruff 进行 linting 和格式化

# Format code
uv run ruff format lance_ray/ tests/ examples/

# Check linting
uv run ruff check lance_ray/ tests/ examples/

# Fix linting issues automatically
uv run ruff check --fix lance_ray/ tests/ examples/

本地构建文档

# Serve documentation locally
cd docs
uv run mkdocs serve

# Documentation will be available at https://:8000

发布流程

本节描述了用于自动化版本管理、发布和发布的 CI/CD 工作流程。

版本方案

  • 稳定版本: X.Y.Z (例如,1.2.3)
  • 预览版本: X.Y.Z-beta.N (例如,1.2.3-beta.1)

创建发布

  1. 创建发布草稿
  2. 转到 Actions → "Create Release"
  3. 选择参数
    • 发布类型 (major/minor/patch)
    • 发布渠道 (stable/preview)
    • 空运行 (不推送地测试)
  4. 运行工作流程 (创建草稿发布)

  5. 审查和发布

  6. 转到发布页面审查草稿
  7. 根据需要编辑发布说明
  8. 点击 "Publish release" 以
    • 对于稳定版本:触发自动 PyPI 发布
    • 对于预览版本:创建测试版(不发布到 PyPI)