-
-
Notifications
You must be signed in to change notification settings - Fork 523
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
Getting environments not found
error when running a partial set of factors
#3096
Comments
In the current version you would have to specify Contents of [tox]
env_list=a-b
a-b
a
b
[testenv]
package=skip
commands_pre =
a: python -c 'print("a")'
b: python -c 'print("b")'
commands=python -c 'print("ok")' And then $ tox -e a
a: commands_pre[0]> python -c 'print("a")'
a
a: commands[0]> python -c 'print("ok")'
ok
a: OK (0.10=setup[0.04]+cmd[0.03,0.03] seconds)
congratulations :) (0.15 seconds) |
But to be fair, you're use case seems perfectly valid to me. Perhaps we can improve it to be smarter about these situations. |
see tox-dev/tox#3096 Signed-off-by: <[email protected]>
PR welcome 👍 |
I'll highjack this issue since I believe while my issue is not exactly the same, it's too closely related to justify a separate issue. This, I believe is valid Tox config, but now fails: [tox]
env_list={3.9}
[testenv]
package = skip
commands =
cov: python -c 'print("with cov")'
!cov: python -c 'print("without cov")' Output: ❯ tox -e 3.9
3.9: commands[0]> python -c 'print("without cov")'
without cov
3.9: OK (0.23=setup[0.21]+cmd[0.02] seconds)
congratulations :) (0.27 seconds)
❯ tox -e 3.9-cov
ROOT: HandledError| provided environments not found in configuration file: ['3.9-cov'] |
@BeyondEvil PR welcome 👍 |
What was the reason for the PR that broke this? It doesn't seem to be related to an issue. |
Because we no longer allow arbitrary tox env creation, and 3.9-cov is not defined. Note it would work as py3.9-cov... but I agree we should accept both pyx.y and x.y as valid on-demand tox envs. |
Just out of curiosity, why not? |
Because people were complaining that typos are also accepted... |
Ah, fair enough. 😊 |
@tjsmart, thank you! I am now leaning toward the idea that the current behavior is more accurate than the previous one. It seems more sensible to have explicitly declared environments, as opposed to running partial factors which could lead to unexpected issues. Take pip-tools' environments for example:
Previously, we could simply run But, consider this example where we know exactly what environments to run and what to expect from tox:
I'm interested to hear what @gaborbernat thinks about this. |
#3099 will fix this. |
Issue
Since
4.9.0
havingenv_list=a-b
intox.ini
and runningtop -e a
raises a error:This error was caught today on on pip-tools' CI (jazzband/pip-tools#1963), see the log. It's likely a regression introduced in #3089.
Environment
Provide at least:
Output of
pip list
of the host Python, wheretox
is installedOutput of running tox
Output of
tox -rvv
Minimal example
tox.ini
:tox
:Expected result
The text was updated successfully, but these errors were encountered: