-
Notifications
You must be signed in to change notification settings - Fork 53
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
The cached poetry installation doesn't recover settings like virtualenvs-in-project
so caching venvs breaks
#150
Comments
One fix would be to run: run: # set your config values here
if: steps.cached-poetry.outputs.cache-hit != 'true' but I guess the better fix would be to figure out where the config is stored, and cache that 👍 |
Hi @sondrelg, do you mean that the user should figure this out and cache it, or do you mean that the action itself should be aware of this? According to Poetry's docs, the config is stored in a different place according to the OS. In my local machine (a Mac), I tried setting the env var |
@zalun adding that would patch the issue (just as @sondrelg's suggestion would). I think handling this in the action isn't trivial (if my suggestion above doesn't work, which I can't really test) and maybe changing the cache instructions would suffice. If @sondrelg agrees, I can open a PR adding his suggestion here Lines 483 to 507 in 4e96961
|
I think for the purposes of the docs here, @zalun's fix addresses this issue, so I'll close this for now 👍 Not sure if you agree with this @sebastian-correa - if not, could you elaborate a bit on what you'd want done? |
Come to think of it, @zalun's suggestion wouldn't work in the case I proposed, would it? It's the same thing, the Action runs a To fix this at the action's level, I would figure out how to tell Poetry to store its configurations in a given directory (the same directory where the action installs Poetry itself) so that caching also brings over configs. Can you guide me through making changes and testing the action myself to see if I can figure out (and contribute) some fix? In the meantime, I opened #154 with the changes you mentioned here, which seem to work in my case. |
Hi! I'm using this action to install poetry like this:
As you can see, I'm caching both the poetry install and the venv creation. However, any runs after the one that creates the cache entry for the poetry install don't correctly set
virtualenvs-in-project
, so if I change my lock file, the venv install step fails to cache (because its using a cached poetry installation that hasn't been configured to install the venv in.venv
and installs it to the default location).How can this be fixed? For now it seems I have to disable the caching of installing poetry, or add a new intermediate step that runs the correct
poetry config
steps. Maybe we also need to cache the output ofpoetry config --list --local
?The text was updated successfully, but these errors were encountered: