Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Pip caching should include Python version in cache key #304

Closed
@reuben

Description

@reuben

Description:
Caching with cache: 'pip' will not include the Python version in the cache key, which leads to a cache that only speeds up the Python version that happened to create the original cache.

Action version:
v2

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
N/A

Repro steps:
I'm fixing the pip caching for the coqui-ai/TTS repo to speed-up the initial setup. We use matrix strategies to test across Python 3.6, 3.7, 3.8 and 3.9. I replaced an older broken actions/cache@v1 setup with the new caching functionality here, and saw a significant speed-up for Python 3.9 tasks, because it was a Py 3.9 job that happened to finish first and write the cache:

Before: https://github.com/coqui-ai/TTS/runs/4559378226?check_suite_focus=true
After: https://github.com/coqui-ai/TTS/runs/4559480121?check_suite_focus=true

On a different job running on Python 3.7, changing to the caching funcionality in setup-python actually slowed things down:

Before: https://github.com/coqui-ai/TTS/runs/4559377735?check_suite_focus=true
After: https://github.com/coqui-ai/TTS/runs/4559592755?check_suite_focus=true

This is because we spend extra time downloading the cache, but then can't use it.

Expected behavior:
The pip cache should be keyed by Python version.

Actual behavior:
The pip cache is shared between Python versions, leading to cached wheels not being used in subsequent runs with different Python versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions