Skip to content

Commit de9902e

Browse files
committed
chore: renew documents.
1 parent 0143736 commit de9902e

File tree

11 files changed

+953
-86
lines changed

11 files changed

+953
-86
lines changed

CONTRIBUTING_CN.md

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# MindCV 贡献指南
2+
3+
欢迎贡献,我们将不胜感激!每一份贡献都是有益的,请接受我们的赞扬。
4+
5+
## 贡献者许可协议
6+
7+
首次向 MindCV 社区提交代码前需签署 CLA。
8+
9+
个人贡献者请参考 [ICLA 在线文档](https://www.mindspore.cn/icla) 了解详细信息。
10+
11+
## 贡献类型
12+
13+
### 报告错误
14+
15+
报告错误至 https://github.com/mindspore-lab/mindcv/issues.
16+
17+
如果您要报告错误,请包括:
18+
19+
* 您的操作系统名称和版本。
20+
* 任何可能有助于故障排除的本地设置详细信息。
21+
* 重现错误的详细步骤。
22+
23+
### 修复Bugs
24+
25+
查阅GitHub issues以了解Bugs。任何带有“bug”和“help wanted”标签的issue都对想要解决它的人开放。
26+
27+
### 实现features
28+
29+
查阅GitHub issues以了解features。任何标有“enhancement”和“help wanted”的issue都对想要实现它的人开放。
30+
31+
### 编写文档
32+
33+
MindCV通常可以使用多种方式编写文档,可以编写在官方MindCV文档中,或者编写在docstrings中,甚至可以编写在网络上的博客、文章上。
34+
35+
### 提交反馈
36+
37+
发送反馈的最佳方式是在 https://github.com/mindspore-lab/mindcv/issues 上提交问题。
38+
39+
如果您要提出一项功能:
40+
41+
* 详细说明它将如何工作。
42+
* 尽可能缩小范围,使其更易于实施。
43+
* 请记住,这是一个志愿者驱动的项目,欢迎贡献 :)
44+
45+
## 入门
46+
47+
准备好贡献了吗?以下是如何设置 `mindcv` 进行本地开发。
48+
49+
1.[GitHub](https://github.com/mindlab-ai/mindcv) 上 fork `mindcv` 代码仓。
50+
2. 在本地克隆您的 fork:
51+
52+
```shell
53+
git clone git@github.com:your_name_here/mindcv.git
54+
```
55+
56+
之后,您应该将官方代码仓添加为upstream代码仓:
57+
58+
```shell
59+
git remote add upper git@github.com:mindspore-lab/mindcv
60+
```
61+
62+
3. 将本地副本配置到 conda 环境中。假设您已安装 conda,您可以按照以下方式设置 fork 以进行本地开发:
63+
64+
```shell
65+
conda create -n mindcv python=3.8
66+
conda activate mindcv
67+
cd mindcv
68+
pip install -e 。
69+
```
70+
71+
4. 为本地开发创建一个分支:
72+
73+
```shell
74+
git checkout -b name-of-your-bugfix-or-feature
75+
```
76+
77+
现在您可以在本地进行更改。
78+
79+
5. 完成更改后,检查您的更改是否通过了linters和tests检查:
80+
81+
```shell
82+
pre-commit run --show-diff-on-failure --color=always --all-files
83+
pytest
84+
```
85+
86+
如果所有静态 linting 都通过,您将获得如下输出:
87+
88+
![pre-commit-succeed](https://user-images.githubusercontent.com/74176172/221346245-ea868015-bb09-4e53-aa56-73b015e1e336.png)
89+
90+
否则,您需要根据输出修复警告:
91+
92+
![pre-commit-failed](https://user-images.githubusercontent.com/74176172/221346251-7d8f531f-9094-474b-97f0-fd5a55e6d3de.png)
93+
94+
要获取 pre-commit 和 pytest,只需使用 pip 安装它们到您的 conda 环境中即可。
95+
96+
6. 提交您的更改并将您的分支推送到 GitHub:
97+
98+
```shell
99+
git add .
100+
git commit -m “您对更改的详细描述。”
101+
git push origin name-of-your-bugfix-or-feature
102+
```
103+
104+
7. 通过 GitHub 网站提交pull request。
105+
106+
## pull request指南
107+
108+
在提交pull request之前,请检查它是否符合以下指南:
109+
110+
1. pull request应包括测试。
111+
2. 如果pull request添加了功能,则应更新文档。将新功能放入带有docstring的函数中,并将特性添加到 README.md 中的列表中。
112+
3. pull request应适用于 Python 3.7、3.8 和 3.9 以及 PyPy。检查
113+
https://github.com/mindspore-lab/mindcv/actions
114+
并确保所有受支持的 Python 版本的测试都通过。
115+
116+
## 提示
117+
118+
您可以安装 git hook脚本,而不是手动使用 `pre-commit run -a` 进行 linting。
119+
120+
运行flowing command来设置 git hook脚本
121+
122+
```shell
123+
pre-commit install
124+
```
125+
126+
现在 `pre-commit` 将在 `git commit` 上自动运行!
127+
128+
## 发布
129+
130+
提醒维护者如何部署。确保提交所有更改(包括 HISTORY.md 中的条目),然后运行:
131+
132+
```shell
133+
bump2version patch # possible: major / minor / patch
134+
git push
135+
git push --tags
136+
```
137+
138+
如果测试通过,GitHub Action 将部署到 PyPI。

0 commit comments

Comments
 (0)