-
Notifications
You must be signed in to change notification settings - Fork 33
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
Bug Report: cimg/python:x.y is unusable with venv caching #250
Comments
IDK how to solve that, though. I couldn't find a way to make |
https://pipenv.pypa.io/en/latest/installation.html#installing-packages-for-your-project
|
I'm sorry, how does that solve the problem? |
- run:
name: install dependencies
command: |
- python -m venv /tmp/venv
- . /tmp/venv/bin/activate
- pip install pipenv
+ pip install --user pipenv
pipenv install --dev
+ # Look at the logs to see where the `virtualenv` is being created.
- save_cache:
paths:
- - /tmp/venv
+ # We need something related to `virtualenv` here (NOT `venv`)
key: << pipeline.parameters.cache-version >>-{{ checksum "Pipfile.lock" }}
+ # We need `pipenv run` to access the installed deps.
+ run: pipenv run ABC |
That won't work either.
And again: if I'm caching that virtualenv, it'll break as soon as the image changed the minor version. |
Describe the bug
Caching venv si common practice as documented. However, on
cimg/python
,python -m venv venv
produces a virtual environment with a symlink to a fixed x.y.z python version (/home/circleci/.pyenv/versions/3.11.10/bin/python
for instance oncimg/python:3.11
.This causes
. venv/activate
to fail withError: [Errno 2] No such file or directory: 'venv/bin/python'
as soon as the image is updated with a new minor Python version.To Reproduce
Using the following
config.yml
:Change the used image from
cimg/python:3.11.4
tocimg/python:3.11
and the CI should fail with the No such file or directory error.Expected behavior
Caching the venv should not make the CI to suddenly fail as soon as the Python minor changes when using
cimg/python:x.y
.Workarounds
Use
cimg/python:x.y.z
instead ofcimg/python:x.y
wich is inconveniant.The text was updated successfully, but these errors were encountered: