-
-
Notifications
You must be signed in to change notification settings - Fork 524
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
feature: generative testenv #465
Comments
@quodlibetor i beleive it woudl already help if factors could apply to more than testenv then you would only need to declare a test and a lint factor, and use the py* factors to expand eg
|
@RonnyPfannschmidt that seems like it should work, but I get a |
@quodlibetor well it currently is not implemented that way, i was suggesting a syntax that could work more easyly |
Oh! Yes, that was the first thing I tried, so it seems like it would have been obvious. But, if you do something like that, then how do you deal with complicated env matrixes? For example, specifying some subset of On the other hand, if you think that api is fine then I could be pretty easily convinced. |
well, from my pov a sensible way to go is to pick all factors of the test env name, and apply the rest from variables below there will be cases it wont be able to handle, but that may be a sensible limitation |
So my main concern would be the following situation:
which |
I believe tox should fail if there is more than.one matching env |
May be I don't quite understand your problem and what you want but I think tox supports this already. Let's look at sample tox.ini:
Here if you run |
@daa this inevitably turns into a utter mess if you want to control dependencies in different envs and have more than one command |
I agree with @RonnyPfannschmidt about using that syntax making complex configs hard to read. Here is me thinking that it also didn't work, and then realizing that it does work, just not in the way that I expected:
[tox]
envlist = {py27,py35}-{test,lint}
skipsdist = true
[testenv]
whitelist_externals =
echo
time
commands =
test: time \
echo test \
one
echo two
lint: echo lint
echo another lint
... snip ...
... snip ...
Oh, wait, this works correctly: [tox]
envlist = {py27,py35}-{test,lint}
skipsdist = true
[testenv]
whitelist_externals =
echo
time
commands =
test: time \
test: echo test \
test: one
test: echo two
lint: echo lint
lint: echo another lint This... works. It will still cause a fairly complex I would still like to have either my original request or the first response to my proposal to tie multiple related testenv variables together. For example, I'm currently, I think, going to end up with something like the following (where each ... is possibly multiple lines): [testenv]
whitelist_externals =
lint: bash
usedevelop =
lint: True
typechk: True
deps =
test: ..A
lint: ..B
typechk: ..C
install_command:
test: ..A
lint: ..A
typechk: ..B
compile: ..C
commands:
test: ..A
lint: ..B
typechk: ..C Which is definitely livable, but not as nice as it could be. |
I would propose to close this as wontfix for the old config format and decide how to implement use cases like this in #999. |
oh, yay! |
As per @obestwalter suggestion. |
I currently have an envlist that looks like
{py27,py35}-{test,pylint}
to get the maximum number of errors out of a CI run.To get this to work without duplicating the commands the only thing I can think of is
This has two downsides compared to being able to do a hypothetical:
I'm not sure how complicated this would be to implement, if there is interest and the testenv expansion wouldn't take tons of knowledge of internals I might be able to devote some time to it this week or weekend.
The text was updated successfully, but these errors were encountered: