-
-
Notifications
You must be signed in to change notification settings - Fork 150
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
[GitHub Action] python is not installed into the virtualenv #735
Comments
On a rerun I got this (different) error:
|
One extra reason why I do not find nox as being able to challenge tox, not being usable outside the box. I has the same problem. |
I have the same issue locally on one of my computer (on the other it works fine). I didn't manage to find any info/documentation on how to fix this. |
Unfortunately, due to wntrblm/nox#735, caching the nox virtual environments causes random intermittant GitHub Actions failures. Until that issue is fixed, only cache the pip cache and remove the settings for a cache prefix and for the dependency glob to decide when to restore the nox virtual environment cache.
I think I have figured out this problem in GitHub Actions. The short version is that you need to include I believe there may be multiple bugs reported together in this issue, but I think the cause of the initial problem is an interaction between the setup-python action, the cache action, and the way nox virtual environments are cached. (If so, it is not a nox bug.) As documented in https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#check-latest-version, actions/setup-python by default caches Python. If you install Python by minor version (3.12, for example, not 3.12.1), the patch version that you get therefore depends on the local cache and may flip back and forth depending on what GitHub Actions runner you happen to get. When Python creates a virtualenv, the The fix is to ensure that you do not use a nox virtualenv cache with a different patch version of Python. The easiest way to do this is to include the value of I expect you will see this problem whenever a new patch version of Python is released for one of the minor versions that you test, if the caching isn't by patch version. Other workarounds would be to always use |
I should also add that while I don't believe this is a nox bug, I think nox could in theory detect that this has happened and recreate the venv for the session, which may fix the other non-GitHub-Actions comments on this issue. It would need to check whether the running version of Python exactly matches the version of Python used to set up the venv, and recreate the venv if this is not the case. I believe tox does this, although I'm not sure. |
Current Behavior
Hi there, I'm having an seemingly random issue with nox on GitHub actions, here's an example of a test failure:
https://github.com/strawberry-graphql/strawberry/actions/runs/5790313890/job/15693180713?pr=3015
I'm not sure why this happens, and especially why it only happens on 3.12, maybe I setup the cache wrongly?
The full error is:
Here's the action I'm using:
The text was updated successfully, but these errors were encountered: