Poetry caching fails because Poetry is not installed
See original GitHub issueDescription: Poetry caching fails because Poetry is not installed.
Action version: v3
Platform:
- Ubuntu
- macOS
- Windows
Runner type:
- Hosted
- Self-hosted
Tools version: All Python versions.
Repro steps:
Run a workflow with the setup-python
action using the cache: 'poetry'
argument. I have set up a minimal reproduction in a public repository. There is an example of a failed workflow run in that project.
Expected behavior: I would expect Poetry dependencies to be restored if they exist.
Actual behavior:
The step fails due to a missing poetry
executable.
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Commands | master | Documentation | Poetry - Python ...
--no-cache : Disables Poetry source caches. --directory=DIRECTORY (-C) : The working directory for the Poetry command (defaults to the current working ...
Read more >Poetry fails whenever I try to run cicd in GitHub Actions
I'm facing a problem with Poetry and GitHub actions in the last days. Maybe because Poetry has an updated version. Information.
Read more >Poetry vs. Docker caching: Fight! - Python⇒Speed
Poetry's versioning scheme for Python dependencies makes Docker caching harder, which means slower images rebuilds. Learn some workarounds.
Read more >Poetry Advance - Python Biella Group
This problem can occur as soon as you run a library installation or do poetry install or poetry update . ⚠ Attention ⚠...
Read more >How To Install Poetry to Manage Python Dependencies on ...
txt . In this tutorial you will install Poetry using the official installation script, set up a Poetry project with a virtual environment,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Doesn’t work for me as of today @4.2.0
The reason I’m not filing a separate is I think it’d be closed on the same grounds as this issue.
But I’d like to note my workaround for python versions and poetry 1.x to work:
It looks like installing
poetry
beforeactions/setup-python
causespoetry
to use the earlier python version. e.g. if GH uses python 3.8 by default and poetry is installed in that, your poetry is going to run in 3.8, no matter whatactions/setup-python
is.It looks like
poetry install
doesn’t obey the python version that actions/setup-python uses.Here’s an example
https://github.com/vcs-python/libvcs/runs/5801763507?check_suite_focus=true
https://github.com/vcs-python/libvcs/blob/f2798b8d4e5199a88d16118f2ade74b328e860f6/.github/workflows/tests.yml
It also happens when installing via
pipx install poetry
My workaround is to use a matrix and
poetry env <version>
You can replace "Install poetry
with
pipx install poetry, or
pipx install poetry==1.1.12`, etc.