Skip to content

Commit db0d5a3

Browse files
committed
补充使用虚拟环境步骤,打包前使用pytest做基本测试
1 parent 571f8b1 commit db0d5a3

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

README-en.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,11 @@ xanalyzer -u "https://www.baidu.com/s?wd=hello"
7272
git clone https://github.com/qux-bbb/xanalyzer
7373
cd xanalyzer
7474
virtualenv venv
75+
# use venv in windws: .\venv\Scripts\activate
76+
# use venv in linux: source venv/bin/activate
7577
pip install -r requirements.txt
7678
python setup.py develop
79+
# exit venv: deactivate
7780
```
7881
Then you can develop and debug with pycharm or vscode
7982

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,11 @@ xanalyzer -u "https://www.baidu.com/s?wd=hello"
7272
git clone https://github.com/qux-bbb/xanalyzer
7373
cd xanalyzer
7474
virtualenv venv
75+
# windws使用虚拟环境: .\venv\Scripts\activate
76+
# linux使用虚拟环境: source venv/bin/activate
7577
pip install -r requirements.txt
7678
python setup.py develop
79+
# 退出虚拟环境: deactivate
7780
```
7881
这样之后就可以用pycharm或vscode开发调试了
7982

@@ -82,10 +85,14 @@ python setup.py develop
8285

8386
打包前确保版本号和CHANGELOG.md已更新,清空dist文件夹
8487

85-
安装依赖并打包
88+
安装依赖、通过测试项、打包
8689
```r
90+
# windws使用虚拟环境: .\venv\Scripts\activate
91+
# linux使用虚拟环境: source venv/bin/activate
8792
pip install -r requirements.my.txt
93+
pytest
8894
python setup.py sdist bdist_wheel
95+
# 退出虚拟环境: deactivate
8996
```
9097

9198
重新打开一个命令行,转到dist文件夹下本地安装,检查基本功能,举例:

requirements.my.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
pytest==7.3.1
12
setuptools==65.5.1
23
wheel==0.38.1
34
twine==3.8.0

0 commit comments

Comments
 (0)