Replies: 9 comments 1 reply
-
I just ran into this as well. |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
As explained by the author, the
tox-gh-actions should print a warning or error out if the right side of the list item is not a valid factor (e.g. if it contains a hyphen |
Beta Was this translation helpful? Give feedback.
-
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?
Beta Was this translation helpful? Give feedback.
All reactions