С oumand tox -r do deploy venv python在项目中
我有一些项目,可以通过Windows正确的工作在本地PC上。 当我通过服务器上的GitLab复制此项目时,我看不到一些文件夹。 因此,TOX -R命令不在项目中部署Venv Python。我该如何解决? tox.ini:
[tox]
skipsdist = True
envlist = testenv
[testenv]
basepython = python3.7
alwayscopy=true
envdir = venv
setenv =
PYTHONPATH={toxinidir}/framework{:}{toxinidir}/pytest_plugins{:}venv/Lib/site-packages/
PYTHONIOENCODING = UTF-8
deps =
attrdict
Faker==5.0.1
luhnpy==1.0.0
mimesis==4.1.2
pytest==4.4.0
requests
selenium==3.141.0
openpyxl
commands =
-python`
I have some project, that on my local pc by windows correct work.
When I copy this project through gitlab on server, I don't see some folders.
So, tox -r command doesn't deploy venv python in project. How can I fix this?
Tox.ini :
[tox]
skipsdist = True
envlist = testenv
[testenv]
basepython = python3.7
alwayscopy=true
envdir = venv
setenv =
PYTHONPATH={toxinidir}/framework{:}{toxinidir}/pytest_plugins{:}venv/Lib/site-packages/
PYTHONIOENCODING = UTF-8
deps =
attrdict
Faker==5.0.1
luhnpy==1.0.0
mimesis==4.1.2
pytest==4.4.0
requests
selenium==3.141.0
openpyxl
commands =
-python`
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Tox利用Python(3)-venv创建VENV文件夹。
VENV文件夹在Windows和Linux上看起来不同。如Windows中的屏幕截图所示,您的文件夹
脚本
,而在Linux中,您有文件夹bin
。tmp
文件夹是特定于Windows的,在Linux中创建时不存在。因此,这是预期的行为,我们不知道您要实现什么。
这就是您在Windows中激活VENV的方式:
激活Linux中的VENV:第一行。
这就是您在使用
venv
文件夹中工作目录时Tox utilizes python(3)-venv to create the venv folder.
The venv folder looks different on Windows and Linux. As shown in your screenshot in Windows you have folder
Script
whereas in Linux you have the folderbin
.The
tmp
folder is Windows specific and does not exist when creating in Linux.So this is intended behavior and we don't know what you are trying to achieve.
This is how you activate the venv in Windows:
This is how you activate the venv in Linux:
First line when you are in working directory with the
venv
folder.我发现问题。我需要添加yml文件命令源/home/gitlab-runner/xxx/venv/bin/activate
I find problem. I needed to add in yml file command source /home/gitlab-runner/xxx/venv/bin/activate