开发
大约 1 分钟
开发
开发流程
在开始编写新功能之前,请先创建一个问题并在问题跟踪器中讨论详细信息。
环境设置
本指南假设您已拥有GitHub账户,安装了Python 3,virtualenv以及Git。该指南是为Bash编写的,对于Windows系统,您可以使用例如随Git捆绑在一起的Bash。
- Fork pywebview
- 克隆您分叉的仓库
git clone https://github.com/<username>/pywebview
cd pywebview
- 创建虚拟环境
virtualenv -p python3 venv
source venv/bin/activate
pip install -e .
pip install pytest
- Hello world
python examples/simple_browser.py
开发工作流程
- 创建并切换到新分支
git checkout -b new-branch master
进行您的修改
运行测试
pytest tests
- 提交并推送上您的工作
git add .
git commit -m "Your commit message goes here"
git push -u origin new-branch
测试
pywebview 使用 pytest 进行测试。
要在项目根目录中运行所有测试:
pytest tests
要运行特定的测试:
pytest tests/test_simple_browser.py
测试仅涵盖简单的错误,语法错误,异常等。换句话说,并没有功能测试。每个测试均验证在不同情况下运行时,pywebview窗口可以无错误地打开和退出。有时测试会随机失败或卡死。导致此问题的原因尚不清楚,任何帮助解决随机失败的问题都将不胜感激。