Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- name: Lint with ruff
run: |
uv tool run ruff check .
uv tool run ruff format --check .

test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.10', '3.11', '3.12', '3.13']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y cmake || brew install cmake
uv sync --extra dev
- name: Run tests
run: uv run pytest
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ dist/
.eggs/
*.egg-info/

# uv
.venv/
.python-version

# IDEs
.cursor/
.vscode/
Expand All @@ -19,4 +23,4 @@ unilab/algos/torch/rsl_rl

third-party
temp/
agent/
agent/
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
hooks:
- id: ruff
args: [--fix]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.0
hooks:
- id: mypy
additional_dependencies: [types-all]
args: [--ignore-missing-imports]
48 changes: 48 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Development Standards

## Package Management

**Always use `uv run`, not python**.

This project uses `uv` for package management and execution. All Python commands should be run through `uv run`:

```bash
# ✅ Correct
uv run python script.py
uv run pytest
uv run python -m module

# ❌ Incorrect
python script.py
pytest
python -m module
```

## Installation

Install dependencies with:
```bash
uv sync
```

For development dependencies:
```bash
uv sync --extra dev
```

For motrix support:
```bash
uv sync --extra motrix
```

## Cross-Platform Support

### macOS (MPS)
- PyTorch with MPS backend (default from PyPI)
- MLX framework (Apple Silicon only)

### Linux (CUDA)
For CUDA support, install PyTorch with CUDA after `uv sync`:
```bash
uv pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121
```
36 changes: 36 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Contributing to UniLab

## 开发环境设置

1. Fork 并克隆仓库
2. 安装依赖:`uv sync --extra dev`
3. 创建功能分支:`git checkout -b feat/your-feature`

## 开发规范

- **Always use `uv run`**,不要直接使用 `python`
- 遵循代码风格:运行 `uv run ruff format .`
- 提交前检查:`uv run ruff check .`
- 运行测试:`uv run pytest`

## 提交规范

使用 Conventional Commits:

- `feat:` 新功能
- `fix:` 修复 bug
- `docs:` 文档更新
- `refactor:` 代码重构
- `test:` 测试相关
- `chore:` 构建/工具链

## Pull Request 流程

1. 确保所有测试通过
2. 更新相关文档
3. 提交 PR 到 `main` 分支
4. 等待 code review

## 问题反馈

使用 GitHub Issues 报告 bug 或提出功能建议。
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 UniLab Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
Loading