Skip to content

Commit 934229c

Browse files
authored
docs: update CONTRIBUTING.md to use uv package manager (#2855)
1 parent db2e943 commit 934229c

File tree

1 file changed

+52
-7
lines changed

1 file changed

+52
-7
lines changed

CONTRIBUTING.md

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,66 @@ conda activate dbgpt_env
3131
cd DB-GPT
3232
```
3333

34-
3. Install the project from the local source using the following command:
34+
3. Install uv package manager:
35+
36+
There are several ways to install uv:
37+
38+
**Option 1: Using pipx (Recommended)**
39+
```bash
40+
python -m pip install --upgrade pip
41+
python -m pip install --upgrade pipx
42+
python -m pipx ensurepath
43+
pipx install uv
3544
```
36-
# it will take some minutes
37-
pip install -e ".[default]"
45+
46+
**Option 2: Using curl (macOS/Linux)**
47+
```bash
48+
curl -LsSf https://astral.sh/uv/install.sh | sh
3849
```
3950

40-
4. Install development requirements
51+
Then verify uv installation:
52+
```bash
53+
uv --version
4154
```
42-
pip install -r requirements/dev-requirements.txt
43-
pip install -r requirements/lint-requirements.txt
55+
56+
4. Install the project and all dependencies using uv:
57+
```bash
58+
# This will install all packages and development dependencies
59+
# it will take some minutes
60+
uv sync --all-packages \
61+
--extra "base" \
62+
--extra "proxy_openai" \
63+
--extra "rag" \
64+
--extra "storage_chromadb" \
65+
--extra "dbgpts"
66+
```
67+
68+
**Note for users in China:** If you encounter network issues, you can configure uv to use Chinese mirrors:
69+
```bash
70+
# Set environment variable for Tsinghua mirror
71+
export UV_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
72+
73+
# Or add --index-url parameter to the sync command
74+
uv sync --all-packages \
75+
--extra "base" \
76+
--extra "proxy_openai" \
77+
--extra "rag" \
78+
--extra "storage_chromadb" \
79+
--extra "dbgpts" \
80+
--index-url=https://pypi.tuna.tsinghua.edu.cn/simple
4481
```
4582

4683
5. Install pre-commit hooks
4784
```
48-
pre-commit install
85+
uv run pre-commit install
86+
```
87+
88+
**Important Note:** After using `uv sync`, you should use `uv run` to execute commands in the virtual environment, or you can activate the environment with:
89+
```bash
90+
# Activate the virtual environment
91+
source .venv/bin/activate # On macOS/Linux
92+
# or
93+
.venv\Scripts\activate # On Windows
4994
```
5095

5196
6. Install `make` command

0 commit comments

Comments
 (0)