'Сommand tox -r doesn't deploy venv python in project

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`

Folder structure: enter image description here



Solution 1:[1]

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 folder bin.
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:

.\venv\Scripts\activate

This is how you activate the venv in Linux:

source venv/bin/activate
source /path/to/venv/bin/activate

First line when you are in working directory with the venv folder.

Solution 2:[2]

I find problem. I needed to add in yml file command source /home/gitlab-runner/xxx/venv/bin/activate

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Galoperidol