Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve docs about tox virtualenv test environment configuration #105

Closed
fkromer opened this issue Apr 29, 2018 · 1 comment
Closed

Improve docs about tox virtualenv test environment configuration #105

fkromer opened this issue Apr 29, 2018 · 1 comment

Comments

@fkromer
Copy link

fkromer commented Apr 29, 2018

How need tox virtualenv test environments [testenv:NAME] to be configured that they are executed as Travis jobs? Right now I use the default tox-travis configuration in my .travis.yml and a tox.ini with envlist for the Python interpreters and testenv:...s for tox jobs.

  1. How could I run one tox testenv (e.g. [testenv:tests]) with one (envlist=pypy) Python interpreter?
  2. How could I run one tox testenv (e.g. [testenv:tests]) with all Python interpreters (envlist = py27, py34, py35, pypy)?
  3. How could I run several tox testenvs (e.g. [testenv:tests], [testenv:lint]) with one (envlist=pypy) Python interpreter?
  4. How could I run several tox testenvs (e.g. [testenv:tests], [testenv:lint]) with all Python interpreters (envlist = py27, py34, py35, pypy)? ("Merge" of 2. and 3. config?)
@ryanhiebert
Copy link
Collaborator

ryanhiebert commented Mar 14, 2019

I'm honestly not sure how I missed this issue, I apologize.

Currently the way to specify which version of Python to run an environment under is by including it as a factor in the env name, like pypy-tests or something. It's also possible to manually specify which envs to run for each python version with the python configuration item in the travis section, as described in the "Advanced Configuration" section of the "Env Detection" page in the docs. https://tox-travis.readthedocs.io/en/stable/envlist.html#advanced-configuration.

The testenv section is a base configuration for all testenvs if no specification is provided to Tox. I'd recommend configuring things there, and then just having the different version listed in the envlist should do what you need, like envlist = py27, py37, pypy. Adding factors like lint-py27, lint-py37, tests-py27, tests-py37 can help you build a matrix of other types of test envs. This is really the only mechanism provided by tox for the kind of factoring you want to do, and it is this mechanism that tox-travis builds on top of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants