Open JCZuurmond opened 3 years ago
@JCZuurmond - I would love to add tox support in a more useful way - I'm afraid of adding tox support to the existing job and having some users expect it to scale effectively (i.e. easily use/create a separate env for each python version). Ultimately, I think a proper tox
job should be created soon that can take advantage of some of the features planned for monorepo support. Features for monorepo support might allow us to parse the envlist
from the tox.ini
to properly run the workflows with the right parameters to easily parallelize the env tests.
For now, you should be able to get a tox job going like this. It should theoretically also cache the python versions (and tox) for you, but if the envlist changes, you might need to release/rebuild the cache
version: 2.1
orbs:
python: circleci/python@1.3
workflows:
main:
jobs:
- build
jobs:
build:
docker:
- image: cimg/python:3.8.7
steps:
- checkout
# This will cache the other python versions we installed
- python/install-packages:
pkg-manager: pip
args: tox
pypi-cache: true
venv-cache: false
pre-install-steps:
- run: pyenv install 3.7.8
- run: pyenv install 2.7.18
- run: pyenv local 3.8.7 3.7.8 2.7.18
- run:
name: "Run tox"
command: tox
I'm on the fence about the solution @dsayling described being incorporated into the orb, creating a make-tox
command to generate a group of tox workflows. On the flipside, I'm unsure how easy this would be using our standard bash methods, especially if we have to combine with other orbs/commands/what have you (since we'd have to parse yaml to properly generate/merge changes).
Describe Request:
Use tox to run your test suite with the test job - next to
unittest
andpytest
.Examples:
I would expect the following to work:
It would be nice to add another parameter
tox-posargs
to interactively pass positional arguments to tox.Supporting Documentation Links:
tox