GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||
GeezerVison is showing github.com — Output `python-versions`, containing all Python versions, for cache-busting by kurtmckee · Pull Request #611 · actions/setup-python Conversation
|
| pythonVersions.push( | ||
| `${installed.resolvedPythonVersion}-pypy${installed.resolvedPyPyVersion}` | ||
| ); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Do we need to change pypy and python version parts order ?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with either order.
I did it this way for potential parsing purposes later in the workflow. It seemed like if someone wanted to determine all of the Python versions (regardless of CPython vs PyPy implementation), it would be easier if the Python version appeared at the beginning of the string. If -pypy appeared later in the string it could be stripped off or extracted out as needed.
However, I don't view the ordering as a critical need, and can change the order if desired.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| core.info(`Successfully set up ${installed.impl} (${pythonVersion})`); | ||
| } | ||
| } | ||
| core.setOutput('python-versions', pythonVersions.sort().join(',')); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Do we need to sort versions ?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I sorted it to help stabilize the cache key. If one developer writes their workflow YAML file as:
- uses: actions/setup-python@v4 with: python-version: | 3.11 3.10 3.9 3.8 3.7
and the versions are later rearranged to:
- uses: actions/setup-python@v4 with: python-version: | 3.7 3.8 3.9 3.10 3.11
sorting the versions will provide stability to the cache key.
I currently think this is beneficial behavior, but can remove the sorting if desired.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@dmitry-shibanov I just saw the new support for "allow-prereleases", which is fantastic! I would love to get additional feedback about this PR, or to have it merged, so that I can use this new output as a cache key. I don't know if I communicated the use case well, so to summarize: Setting up a GitHub runner for each Python version is comparatively expensive for some of my projects -- it can take 30 seconds to spin up a runner, 5 seconds to set up the tox environment, but the test suite only takes 2 seconds to run for each Python version. Therefore I install all Python versions on a single runner:
The cache needs to be invalidated if any Python version changes, and this PR makes that possible. Python 3.12 releases are coming out with frequency, and I would like to take advantage of the new "allow-prereleases" feature and have this Thanks for your time, and your work on setup-python! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
python-versions, containing all Python versionspython-versions, containing all Python versions, for cache-busting
|
@dmitry-shibanov, please let me know if you have additional feedback. I'm interested in having this PR merge for effective cache-busting when multiple Python versions are installed. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
197e69d to
949d439
Compare
|
Rebased on |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
949d439 to
2d235cd
Compare
|
I'm closing this PR because I've written a GitHub action to address my need for strong cache-busting based on installed Python versions. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Identify all installed Python versions
There was an error while loading. Please reload this page.