ymyzk / tox-gh-actions

Seamless integration of tox into GitHub Actions for tox 3 and 4
MIT License
249 stars 25 forks source link

Tox is running different python version to the one installed by Github Actions #186

Closed elParaguayo closed 1 year ago

elParaguayo commented 1 year ago

Describe the bug Tox is running different python version to the one installed by Github Actions.

When tox first upgraded to version 4, we pinned this to version 3 as tox-gh-actions didn't have support for version 4 at the time. Now that support is available I'm trying to upgrade our CI to use tox 4 but, when it runs, it's always running the py310 environment.

To Reproduce Here is a run showing the issue. https://github.com/qtile/qtile/actions/runs/5719643898/job/15497980619?pr=4364 - this is run with tox -vv for additional debugging info.

While all tests pass, this hides the fact that they're all running py310. Take a look at the python 3.11 job - tox is called in "Run Tests" section.

Expected behavior I expect the environment to match the installed python version as it did before updating to tox 4.

Additional context Apologies if I've done something stupid here. Appreciate any help you can provide.

ymyzk commented 1 year ago

Hello, @elParaguayo.

I'm having a look at your PR: https://github.com/qtile/qtile/pull/4364/files#diff-ef2cef9f88b4fe09ca3082140e67f5ad34fb65fb6e228f119d3812261ae51449L20

I haven't verified by myself, but one hypothesis I have is that this change in the GitHub Actions configuration is causing the issue.

-               sudo pip -q install meson PyGObject
+               pip -q install "tox<4" tox-gh-actions 
+               sudo pip -q install meson PyGObject tox tox-gh-actions

I think sudo pip -q install meson PyGObject tox tox-gh-actions installs tox and tox-gh-actions to the system level's Python, not Python installed by actions/setup-python.

Could you try the following instead?

               sudo pip -q install meson PyGObject
               pip -q install tox tox-gh-actions