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

Please add a [tox]default_envlist setting #223

Closed
pytoxbot opened this issue Sep 17, 2016 · 4 comments
Closed

Please add a [tox]default_envlist setting #223

pytoxbot opened this issue Sep 17, 2016 · 4 comments

Comments

@pytoxbot
Copy link

Maybe I'm missing something obvious, but I think I want a way to both define a bunch of environments, including some generated ones, but I also want tox-with-no-args to only run a few of them by default.

For example:

[tox]
envlist = py27,py34,coverage-{py27,py34},fast-{py27,py34}

Now, if I run just tox it will run all these tests. But I want to make it easy for my users and CI system to only run a few of those environments by default. So I'd like for tox with no arguments to e.g., only run fast-py27 and fast-py34.

Then, if they say something like tox --all it would run all environments. One thought would be to add something like:

[tox]
envlist = py27,py34,coverage-{py27,py34},fast-{py27,py34}
default_envlist = fast-{py27,py34}

and that would be the no-arg set of environments that get run. --all would ignore default_envlist.

I guess this can work with an explicit -e option and the current default to run all environments, but it's a little less convenient because the set of all environments could change and then I'd have to retool my CI or update my README, etc.

Or is this a dumb idea? ;)

@pytoxbot
Copy link
Author

Original comment by @warsaw

I've been thinking about this lately and I think I might have an elegant way to define env groups. E.g.:

[tox]
envlist =
    default: py34,py35
    all: {py34,py35}-{,-coverage,-diffcov},{-pg}
    ci: py35
    merges: {py34,py35}-diffcov

and so on. Then if you run tox it will be as if you ran tox -g default. If you run tox -e py35 it would not run any group, so -e and -g would be mutually exclusive. If you have only envlist = py34,py35 for example (i.e. no explicit groups), then that's as if you defined the default group.

It borrows the syntax for generated environments, but it seems pretty intuitive. What do you think?

@pytoxbot
Copy link
Author

Original comment by @warsaw

Groups is a pretty neat idea actually. I could imagine you'd have an all group, maybe a smoketest group, possibly a release group. Having a default group would certainly scratch the itch described here. I rather like the --select-factor idea too, but perhaps there's a clever way to turn factors into groups so that it's really just one new feature?

@pytoxbot
Copy link
Author

Original comment by @hpk42

I sympathize with the idea.

Would it make sense to introduce "groups" which you can select with tox -g GROUPNAME where the argument defaults to the "default" group? The groups would be defined with a multiline-option "groups" where you can specify "default" and e.g. "dev", "release" groups.

I can imagine others might simply want to specify a factor like "tox --select-factor fast". or "tox --select-factor coverage".

maybe your suggestion is sufficient and i am going a bit overboard, not sure ATM.

@obestwalter
Copy link
Member

As the idea of grouping envs is likely to be a nice solution for this I'll close this in favour of #238. Hope that's alright.

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

No branches or pull requests

2 participants