TLDR: The cache created in the python orb contains libraries and binaries that are stored or linked to a path that contains the python version, which causes an error in builds where a python version is updated.
The python orb caches the site-packages and the entire virtualenv (including the binaries and libraries), if using pipenv or poetry. For example, after creating a virtualenv you'll see that the python binary for the virtualenv titled "project" is still linked to the global binary.
Because of this, when you change the python version and don't update a dependency file, any restored cache will be linked to original python version and will cause the build to fail.
Expected behavior:
When the python version on the system changes, the orb should not restore from the existing cache.
Additional Information:
Work arounds:
There are a few work arounds to this while a fix is investigated.
Make sure that your PIpfile or pyproject.toml specifies the full python version inside and regenerate the lock file. This will ensure the cache doesn't reload this time.
Update the cache-version parameter on the command or job. This will ensure the cache doesn't reload this time.
Ensure the tag parameter is set in the executor with the full version. The list of tags is available here.
Orb version:
1.0.0+
What happened:
TLDR: The cache created in the python orb contains libraries and binaries that are stored or linked to a path that contains the python version, which causes an error in builds where a python version is updated.
The python orb caches the site-packages and the entire virtualenv (including the binaries and libraries), if using
pipenv
orpoetry
. For example, after creating a virtualenv you'll see that the python binary for the virtualenv titled "project" is still linked to the global binary.If using pip-globally, we can show that the site-packages are linked to a path with a version as well
Because of this, when you change the python version and don't update a dependency file, any restored cache will be linked to original python version and will cause the build to fail.
Expected behavior:
When the python version on the system changes, the orb should not restore from the existing cache.
Additional Information:
Work arounds:
There are a few work arounds to this while a fix is investigated.
PIpfile
orpyproject.toml
specifies the full python version inside and regenerate the lock file. This will ensure the cache doesn't reload this time.cache-version
parameter on the command or job. This will ensure the cache doesn't reload this time.tag
parameter is set in the executor with the full version. The list of tags is available here.