mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-05 10:29:36 +00:00
docks: update CONTRIBUTING.md to use uv package manager
This commit is contained in:
parent
06de6ea08d
commit
a44344fb03
@ -31,21 +31,66 @@ conda activate dbgpt_env
|
|||||||
cd DB-GPT
|
cd DB-GPT
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Install the project from the local source using the following command:
|
3. Install uv package manager:
|
||||||
```
|
|
||||||
# it will take some minutes
|
There are several ways to install uv:
|
||||||
pip install -e ".[default]"
|
|
||||||
|
**Option 1: Using pipx (Recommended)**
|
||||||
|
```bash
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
python -m pip install --upgrade pipx
|
||||||
|
python -m pipx ensurepath
|
||||||
|
pipx install uv
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Install development requirements
|
**Option 2: Using curl (macOS/Linux)**
|
||||||
|
```bash
|
||||||
|
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||||
```
|
```
|
||||||
pip install -r requirements/dev-requirements.txt
|
|
||||||
pip install -r requirements/lint-requirements.txt
|
Then verify uv installation:
|
||||||
|
```bash
|
||||||
|
uv --version
|
||||||
|
```
|
||||||
|
|
||||||
|
4. Install the project and all dependencies using uv:
|
||||||
|
```bash
|
||||||
|
# This will install all packages and development dependencies
|
||||||
|
# it will take some minutes
|
||||||
|
uv sync --all-packages \
|
||||||
|
--extra "base" \
|
||||||
|
--extra "proxy_openai" \
|
||||||
|
--extra "rag" \
|
||||||
|
--extra "storage_chromadb" \
|
||||||
|
--extra "dbgpts"
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note for users in China:** If you encounter network issues, you can configure uv to use Chinese mirrors:
|
||||||
|
```bash
|
||||||
|
# Set environment variable for Tsinghua mirror
|
||||||
|
export UV_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
|
||||||
|
|
||||||
|
# Or add --index-url parameter to the sync command
|
||||||
|
uv sync --all-packages \
|
||||||
|
--extra "base" \
|
||||||
|
--extra "proxy_openai" \
|
||||||
|
--extra "rag" \
|
||||||
|
--extra "storage_chromadb" \
|
||||||
|
--extra "dbgpts" \
|
||||||
|
--index-url=https://pypi.tuna.tsinghua.edu.cn/simple
|
||||||
```
|
```
|
||||||
|
|
||||||
5. Install pre-commit hooks
|
5. Install pre-commit hooks
|
||||||
```
|
```
|
||||||
pre-commit install
|
uv run pre-commit install
|
||||||
|
```
|
||||||
|
|
||||||
|
**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:
|
||||||
|
```bash
|
||||||
|
# Activate the virtual environment
|
||||||
|
source .venv/bin/activate # On macOS/Linux
|
||||||
|
# or
|
||||||
|
.venv\Scripts\activate # On Windows
|
||||||
```
|
```
|
||||||
|
|
||||||
6. Install `make` command
|
6. Install `make` command
|
||||||
|
Loading…
Reference in New Issue
Block a user