You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
v3.1's default poetry example uses wrong python version #374
How hard would it be to defer caching to a later step? Then you wouldn't have to rely on the system version of Python. I'm thinking something like this:
@matthew-mcallister@tony this action relies on poetry to tell it's config values. The problem with locking poetry onto 1 version can be solved by installing poetry with curl. This action wil help you https://github.com/snok/install-poetry. However, take note, that it's significantly slower than pipx install poetry
@falkben Your recipe works for me if I disable caching. Otherwise, it still uses the wrong Python. I introduced caching in the latest PR. I'm thinking I might need to delete the cache for some reason.
@dogweather, for me it seems like poetry's ignoring your poetry env use because it thinks that your're already using this env (since config/env values are retrieved from cache). While this behaviour is ok, the strange part is why does it execute the wrong version in the end
Hello everyone. Sorry for the late response. We released a new version of the action and updated the major tag with possible fix. Could you please confirm that everything works as expected.
I encountered this issue as well, and spent some time trying to figure out why this was still happening after upgrading the action to v4.2.0.
It is cache, it had the wrong python version cached.
To solve it, I used the GitHub API to get a list of caches, and then delete it. Once done, I re-ran the workflow, and it rebuilt the cache and had the correct python version.
Reacted by Robert Shecter, call and Abraham Briñez
Activity
[-]actions/setup-python v3.1's default poetry configuration example uses wrong python version[/-][+]v3.1's default poetry example uses wrong python version[/+]matthew-mcallister commentedon Apr 4, 2022
How hard would it be to defer caching to a later step? Then you wouldn't have to rely on the system version of Python. I'm thinking something like this:
dhvcc commentedon Apr 5, 2022
@matthew-mcallister @tony this action relies on poetry to tell it's config values. The problem with locking poetry onto 1 version can be solved by installing poetry with curl. This action wil help you https://github.com/snok/install-poetry. However, take note, that it's significantly slower than
pipx install poetryfalkben commentedon Apr 5, 2022
You can get around this problem by telling
poetryto use the same version of python as installed bysetup-pythonwith thepoetry env usecommandThis has been working for me:
ci(docs): fix poetry (temporarily)
dogweather commentedon Apr 10, 2022
Really weird: I do not get this error on a feature branch / PR:
But I do get the wrong Python version after merged to
master:dogweather commentedon Apr 10, 2022
@falkben Your recipe works for me if I disable caching. Otherwise, it still uses the wrong Python. I introduced caching in the latest PR. I'm thinking I might need to delete the cache for some reason.
dogweather commentedon Apr 10, 2022
Well, I can't find a way to delete the cache, so I've disabled it for now, and the correct Python is used again on
master.dhvcc commentedon Apr 10, 2022
@dogweather, for me it seems like poetry's ignoring your
poetry env usebecause it thinks that your're already using this env (since config/env values are retrieved from cache). While this behaviour is ok, the strange part is why does it execute the wrong version in the endAdd Python 3.10 to CI (#161)
shelper commentedon Jun 10, 2022
same for windows, see #425
and the workaround here does not work 'cus
poetry env use 3.xdoes not work, see python-poetry/poetry#21177 remaining items
Trying workaround with Poetry caching issue.
Trying workaround with Poetry caching issue.
Trying workaround with Poetry caching issue.
dmitry-shibanov commentedon Aug 10, 2022
Hello everyone. Sorry for the late response. We released a new version of the action and updated the major tag with possible fix. Could you please confirm that everything works as expected.
Tenzer commentedon Aug 11, 2022
I can confirm the latest version (4.2.0) fixes the problem in the places I've previously had to add the
poetry env use 3.10workaround. Thanks!dmitry-shibanov commentedon Aug 15, 2022
Hello @Tenzer. Thank you for your response. For now I'm going to close the issue.
build,ci: Python 3.10.6, setup-python@v4
chore(deps): bump github/codeql-action from 2.1.18 to 2.1.19 (#3325)
omBratteng commentedon Aug 31, 2022
I encountered this issue as well, and spent some time trying to figure out why this was still happening after upgrading the action to v4.2.0.
It is cache, it had the wrong python version cached.
To solve it, I used the GitHub API to get a list of caches, and then delete it. Once done, I re-ran the workflow, and it rebuilt the cache and had the correct python version.
dogweather commentedon Aug 31, 2022
How did you delete it? Where did you delete it from?
omBratteng commentedon Aug 31, 2022
First I ran this, to get a list of the caches, in this case, there was only one.
gh api \ -H "Accept: application/vnd.github+json" \ /repos/OWNER/REPO/actions/cachesThen I ran this, to delete the cache, based off of the cache ID in the previous command.
gh api \ --method DELETE \ -H "Accept: application/vnd.github+json" \ /repos/OWNER/REPO/actions/caches/CACHE_IDMore information available here: https://docs.github.com/en/rest/actions/cache
Change the poetry env within the poetry install step
Disable Python installation caching
Fix: Force poetry to use specific environment