Comments (10)
It's always struck me as a bad chicken/egg problem that poetry is the only cache type that requires the environment manager to be installed before it can be used. Even pipenv is not required to be installed
it just uses the default pipenv location.The Poetry default cache location is well known and I bet in CI the vase majority of projects are using that case. The big difference appears to be that the Poetry option is trying to support the fact that Poetry can install virtual environments in the project. Pipenv can also do this but it's just ignored for that option. I'd recommend just caching the default location like Pipenv, or you could have an option for enabling caching in project virtual environments it people use it.
from setup-python.
Hello @sdb9696
Thank you for creating this issue. We will investigate it and get back to you as soon as we have some feedback.
from setup-python.
Hello @sdb9696 – my team ran into this same issue recently. We solved it by pinning the python version in our pyproject.toml
file, under [tool.poetry.dependencies]
. See example below.
[tool.poetry.dependencies]
python = "3.11.4"
from setup-python.
Thanks @andwaredev but we run our CI against all supported python versions to check there are no issues so not sure this workaround will help.
from setup-python.
I find it highly concerning that the recommend and only working solution for caching poetry venvs is to install poetry before setup-python
. It can not be assumed that python is present before setup-python
has run because some runner images will not have python pre-installed.
This is what I would like to see working:
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'poetry'
- run: pipx install poetry
from setup-python.
@silverwind You can tell poetry to use a specific version of python prior to running install poetry env use <python executable>
then run poetry install
https://python-poetry.org/docs/managing-environments#switching-between-environments
from setup-python.
@evilhamsterman doesn't really help me if there is simply no python
installed before setup-python
ran. Of course one could do workarounds by running setup-python
twice, but I rather skip on enabling cache than doing such hacks.
from setup-python.
I find it highly concerning that the recommend and only working solution for caching poetry venvs is to install poetry before
setup-python
. It can not be assumed that python is present beforesetup-python
has run because some runner images will not have python pre-installed.This is what I would like to see working:
- uses: actions/setup-python@v5 with: python-version: '3.12' cache: 'poetry' - run: pipx install poetry
This also makes the assumtion that you have pipx which I do not :)
I'd highly recommend to install poetry as part of this python version fetching if cache is set to poetry.
Chances are everyone is going to need poetry if they are using poetry cache, so maybe get the specific python version with poetry pre-installed. This seems to be the only viable solution.
from setup-python.
This also makes the assumtion that you have pipx which I do not :)
I think setup-python
does install pip and its variants currently, right?
from setup-python.
This also makes the assumtion that you have pipx which I do not :)
I think
setup-python
does install pip and its variants currently, right?
Apparently, it doesn't so to install poetry without pip and having a poetry cache, this would be the ideal:
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'poetry'
- uses: snok/install-poetry@v1
from setup-python.
Related Issues (20)
- Wrong python version installed HOT 8
- J HOT 1
- Slow download HOT 4
- Caching conflicts when using `extra` dependencies HOT 2
- Unable to build requirement with pip HOT 4
- bad setuptools installation in actions/setup-python@v5 HOT 3
- my_script.py HOT 2
- Allow passing installer args to the Windows MSI HOT 1
- Importing psycopg2 (installed via pip) reports: ImportError: /opt/hostedtoolcache/.../3.13.0-alpha.6/.../psycopg2/_psycopg.cpython-313-x86_64-linux-gnu.so: undefined symbol: _PyInterpreterState_Get HOT 1
- macos-14-arm64 with provisionner 2.0.361.1+33a726b54233caea13315dba3887b0e7c5a1d482 can no longer load Python extension HOT 6
- Python 3.8 and 3.9 not found on macOS HOT 11
- Python Path is always first HOT 1
- no such option: --root-user-action HOT 23
- Failing with current ubuntu:latest container HOT 7
- x64 python fails on arm64 images HOT 5
- python3.7-arm64 is not available HOT 12
- Intermittent failures during Post Setup Python step for MacOS HOT 4
- Unable to locate 'pip' when using cache HOT 7
- python-3.7.17-darwin-x64 has broken readline module due missing libncurses HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from setup-python.