Skip to content

Commit

Permalink
补充使用虚拟环境步骤,打包前使用pytest做基本测试
Browse files Browse the repository at this point in the history
  • Loading branch information
qux-bbb committed Jun 17, 2023
1 parent 571f8b1 commit db0d5a3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,11 @@ xanalyzer -u "https://www.baidu.com/s?wd=hello"
git clone https://github.com/qux-bbb/xanalyzer
cd xanalyzer
virtualenv venv
# use venv in windws: .\venv\Scripts\activate
# use venv in linux: source venv/bin/activate
pip install -r requirements.txt
python setup.py develop
# exit venv: deactivate
```
Then you can develop and debug with pycharm or vscode

Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,11 @@ xanalyzer -u "https://www.baidu.com/s?wd=hello"
git clone https://github.com/qux-bbb/xanalyzer
cd xanalyzer
virtualenv venv
# windws使用虚拟环境: .\venv\Scripts\activate
# linux使用虚拟环境: source venv/bin/activate
pip install -r requirements.txt
python setup.py develop
# 退出虚拟环境: deactivate
```
这样之后就可以用pycharm或vscode开发调试了

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

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

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

重新打开一个命令行,转到dist文件夹下本地安装,检查基本功能,举例:
Expand Down
1 change: 1 addition & 0 deletions requirements.my.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pytest==7.3.1
setuptools==65.5.1
wheel==0.38.1
twine==3.8.0

0 comments on commit db0d5a3

Please sign in to comment.