Skip to content

Commit 4ad8a16

Browse files
committed
docs(installation): update installation instructions to include uv support
1 parent 871feff commit 4ad8a16

File tree

2 files changed

+98
-69
lines changed

2 files changed

+98
-69
lines changed

README.md

Lines changed: 49 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -26,62 +26,77 @@
2626

2727
## 安装
2828

29-
`plotfig` 支持通过 `pip` 或源码安装,要求 Python 3.11 及以上版本。
29+
`plotfig` 支持通过包管理器安装或直接从源码中安装,要求 Python 3.11 及以上版本。
3030

31-
### 使用 pip 安装 (推荐)
31+
### 使用包管理器安装 (推荐)
3232

33-
```bash
34-
pip install plotfig
35-
```
33+
=== "uv"
34+
35+
``` bash
36+
uv add plotfig
37+
```
38+
39+
=== "pip"
3640

37-
### 使用 GitHub 源码安装
41+
``` bash
42+
pip install plotfig
43+
```
44+
45+
### 从源码中安装
46+
47+
首先下载源码到某个目录(例如 `/path/to/plotfig`):
3848

3949
```bash
40-
git clone --depth 1 https://github.com/RicardoRyn/plotfig.git
41-
cd plotfig
42-
pip install .
50+
git clone https://github.com/RicardoRyn/plotfig.git /path/to/plotfig
4351
```
4452

45-
## 依赖
53+
然后在您的项目目录中执行:
4654

47-
`plotfig` 依赖若干核心库,这些依赖将在安装过程中自动处理,但需要注意:
55+
=== "uv"
4856

49-
- [surfplot](https://github.com/danjgale/surfplot) 需使用其 GitHub 仓库中的最新版,而非 PyPI 上的版本,因后者尚未包含所需功能。
57+
``` bash
58+
uv add /path/to/plotfig
59+
```
5060

51-
> ⚠️ **指定 `surfplot` 版本**
52-
>
53-
> 由于 PyPI 上的 `surfplot` 版本较旧,缺少 `plotfig` 所需功能,建议通过以下步骤安装其 GitHub 仓库的最新版。
54-
>
55-
> 如果您无须绘制 `brain surface` 图,可以忽略此步骤。
56-
57-
```bash
58-
# 卸载旧版本
59-
pip uninstall surfplot
61+
=== "pip"
6062

61-
# 克隆源码并安装
62-
git clone --depth 1 https://github.com/danjgale/surfplot.git
63-
cd surfplot
64-
pip install .
63+
``` bash
64+
pip install /path/to/plotfig
65+
```
6566

66-
# 安装完成后,返回上级目录并删除源码文件夹
67-
cd ..
68-
rm -rf surfplot
69-
```
67+
> **注意**`/path/to/plotfig` 应替换为实际的路径。
7068
71-
## 贡献
69+
### 贡献
7270

7371
如果您希望体验这些功能或参与 `plotfig` 的开发,可以选择以 开发模式(editable mode) 安装项目。
7472

7573
这种安装方式允许您对本地源码的修改立即生效,非常适合调试、开发和贡献代码。
7674

77-
推荐先 Fork 仓库,然后克隆您自己的 Fork 并安装 `main` 分支:
75+
推荐流程:
76+
77+
1. Fork 本仓库到您的 GitHub 账号
78+
2. 克隆您的 Fork 到本地:
7879

7980
```bash
80-
git clone https://github.com/USERNAME/plotfig.git
81-
cd plotfig
82-
pip install -e .
81+
git clone https://github.com/USERNAME/plotfig.git /path/to/plotfig
8382
```
8483

84+
3. 在您的项目目录中以开发模式安装:
85+
86+
=== "uv"
87+
88+
``` bash
89+
uv add --editable /path/to/plotfig
90+
```
91+
92+
=== "pip"
93+
94+
``` bash
95+
pip install -e /path/to/plotfig
96+
```
97+
98+
> **注意**`/path/to/plotfig` 应替换为实际的路径。
99+
85100
---
86101

87102
**欢迎提交 Issue 或 PR!**

docs/installation.md

Lines changed: 49 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,75 @@
11
# 安装
22

3+
`plotfig` 支持通过包管理器安装或直接从源码中安装,要求 Python 3.11 及以上版本。
34

4-
`plotfig` 支持通过 `pip` 或源码安装,要求 Python 3.11 及以上版本。
5+
## 使用包管理器安装 (推荐)
56

6-
## 使用 pip 安装 (推荐)
7+
=== "uv"
78

8-
```bash
9-
pip install plotfig
10-
```
11-
12-
## 使用 GitHub 源码安装
9+
``` bash
10+
uv add plotfig
11+
```
1312

14-
```bash
15-
git clone --depth 1 https://github.com/RicardoRyn/plotfig.git
16-
cd plotfig
17-
pip install .
18-
```
13+
=== "pip"
1914

20-
## 依赖要求
15+
``` bash
16+
pip install plotfig
17+
```
2118

22-
`plotfig` 依赖若干核心库,这些依赖将在安装过程中自动处理,但需要注意:
19+
## 从源码中安装
2320

24-
- [surfplot](https://github.com/danjgale/surfplot) 需使用其 GitHub 仓库中的最新版,而非 PyPI 上的版本,因后者尚未包含所需功能。
21+
首先下载源码到某个目录(例如 `/path/to/plotfig`):
2522

26-
!!! warning "指定 `surfplot` 版本"
23+
```bash
24+
git clone https://github.com/RicardoRyn/plotfig.git /path/to/plotfig
25+
```
2726

28-
由于 PyPI 上的 `surfplot` 版本较旧,缺少 `plotfig` 所需功能,建议通过以下步骤安装其 GitHub 仓库的最新版。
27+
然后在您的项目目录中执行:
2928

30-
如果您无须绘制 `brain surface` 图,可以忽略此步骤。
29+
=== "uv"
3130

32-
```bash
33-
# 卸载旧版本
34-
pip uninstall surfplot
31+
``` bash
32+
uv add /path/to/plotfig
33+
```
3534

36-
# 克隆源码并安装
37-
git clone --depth 1 https://github.com/danjgale/surfplot.git
38-
cd surfplot
39-
pip install .
35+
=== "pip"
4036

41-
# 安装完成后,返回上级目录并删除源码文件夹
42-
cd ..
43-
rm -rf surfplot
37+
``` bash
38+
pip install /path/to/plotfig
4439
```
4540

46-
## 贡献指南
41+
!!! info
42+
`/path/to/plotfig` 应替换为实际的路径。
43+
44+
## 贡献
4745

4846
如果您希望体验这些功能或参与 `plotfig` 的开发,可以选择以 开发模式(editable mode) 安装项目。
4947

5048
这种安装方式允许您对本地源码的修改立即生效,非常适合调试、开发和贡献代码。
5149

52-
推荐先 Fork 仓库,然后克隆您自己的 Fork 并安装 `main` 分支
50+
推荐流程
5351

54-
```bash
55-
git clone https://github.com/USERNAME/plotfig.git
56-
cd plotfig
57-
pip install -e .
58-
```
52+
1. Fork 本仓库到您的 GitHub 账号
53+
2. 克隆您的 Fork 到本地:
54+
```bash
55+
git clone https://github.com/USERNAME/plotfig.git /path/to/plotfig
56+
```
57+
3. 在您的项目目录中以开发模式安装:
58+
59+
=== "uv"
60+
61+
``` bash
62+
uv add --editable /path/to/plotfig
63+
```
64+
65+
=== "pip"
66+
67+
``` bash
68+
pip install -e /path/to/plotfig
69+
```
70+
71+
!!! info
72+
`/path/to/plotfig` 应替换为实际的路径。
5973

6074
---
6175

0 commit comments

Comments
 (0)