-
-
Notifications
You must be signed in to change notification settings - Fork 26
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Non-listed environment not used even if configured in gh-actions block of tox.ini #44
Comments
I just ran into this as well.
|
Hi @imphil, thanks for filing a ticket. This is actually an expected behavior of the current tox-gh-actions. In short, how tox-gh-actions works is
In this case, A workaround will be running |
Thanks for your answer @ymyzk. I understand the current behavior, but I'm wondering if it couldn't be changed? Is there a reason why only listed environments can be used in gh-actions? Besides, the current behavior is confusing: I have an environment specified in
That's what I'm doing now, but it prevents me from using the (otherwise nice) environment selection in the |
Sure, I can elaborate a bit more on why we're adopting this behavior using a concrete example. Let's consider the following simple example. [tox]
envlist = py39-a, py39-b
[gh-actions]
python =
3.9: py39 The current implementation tries to find environments which has a factor If I understand your expectation correctly and implement it naively, tox-gh-actions should run So, this is a design choice and I feel the first behavior is convenient for more users. That's why it works like this. I'm open to ideas if there's a way to satisfy both use cases while keeping tox-gh-actions behavior consistent.
This may be a source of confusion. What we specify in
Maybe I can have a better workaround and/or an idea by having a look at actual Thanks. |
My problem is related. [tox]
envlist = py3
[testenv]
deps =
pytest
[testenv:py3-ci]
# Dependencies only when running in CI,
# which calls effectively "tox -e py3-ci" (see the gh-actions section below).
deps =
{[testenv]deps}
pytest-github-actions-annotate-failures
[gh-actions]
# Mapping between the Python version used in GitHub Actions matrix builds, and
# the used Tox environment.
python =
3.5: py3-ci
3.6: py3-ci
3.7: py3-ci
3.8: py3-ci
3.9: py3-ci Now,
I think that in this instance |
It's good to run them by default, and tox-gh-actions won't run them at all if they are not mentioned: ymyzk/tox-gh-actions#44
I now finally understand that tox-gh-actions only considers environments that are listed in envlist in tox.ini. Note that the README doesn't explicitly mention that. I would like to argue that this doesn't make much sense. envlist is only the default set of environments to run, when TOXENV isn't set or the The full list of possible environments could be retrieved from tox internals instead. However, if that doesn't work with the envisaged design, perhaps the |
I just learned about tox's skip_missing_interpreters configuration option. This can provide a solution in some cases, but not for the "py3-ci" case described in this issue's description. |
I was coming here to report the same problem 🙂 First, thanks for making this plugin — a small tox config section is much nicer than having to translate I am also used to using tox is capable of determining the list of valid envs (see |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
I have a tox.ini that looks like this (a bit stripped down):
What I want to achieve is the following: run the py3-ci environment when running tox in GitHub Actions, but run the py3 environment otherwise. If I'd list the
py3-ci
environment inenvlist
, normal developers runningtox
would also get this environment if they don't override it on the command line.Manually running
tox py3-ci
works fine and tox picks the right factor/environment, but when I runtox
(without any argument) in GitHub actions, tox doesn't run anything.Is there a bug somewhere that tries to match the environments in in the gh-actions key against the ones in envlist?
The text was updated successfully, but these errors were encountered: