I'd like to execute unit test (configured in tox.ini) in a docker container using tox-docker plugin. The idea behind it is to be able run unit tests, that require cuda-python module, on a MacBook with Apple M2 Pro.
My question is - how should I configure a corresponding section in a tox.ini so that the requirements are installed in a docker container, but not locally (because this would fail)?
Here is mentioned section in a tox.ini:
[testenv:test-docker-env]
docker =
py-3.11
skip_install = false
deps =
# -r{toxinidir}/requirements/requirements.txt # <- this fails when executed locally on MacBook!
-r{toxinidir}/requirements/requirements-test.txt
commands =
python -m pytest --cov=src \
--cov-report term-missing \
--cov-report xml:coverage-reports/coverage-BUILD_{env:BUILD_NUMBER:0}.xml \
--junitxml=xunit-reports/xunit-result-BUILD_{env:BUILD_NUMBER:0}.xml \
-vv \
tests/
[docker:py-3.11]
image = python:3.11
How can i instruct tox-docker to install required modules from the {toxinidir}/requirements/requirements.txt, but not let tox to install them locally?
I don't believe a plugin could instruct
toxto install some dependencies but not other;toxjust installs locally whatever it sees intox.ini. So I think you need to remove non-local dependencies fromtox.iniand install them in aDockerfile.