Title: Python-version output for PyPy isn't unique across different versions · Issue #1109 · actions/setup-python · GitHub
Open Graph Title: Python-version output for PyPy isn't unique across different versions · Issue #1109 · actions/setup-python
X Title: Python-version output for PyPy isn't unique across different versions · Issue #1109 · actions/setup-python
Description: Description: At the moment the python-version output for PyPy only includes the PyPy release version. In our workflow we use the python-version output to calculate a custom cache key. This breaks if the output for different minor version...
Open Graph Description: Description: At the moment the python-version output for PyPy only includes the PyPy release version. In our workflow we use the python-version output to calculate a custom cache key. This breaks i...
X Description: Description: At the moment the python-version output for PyPy only includes the PyPy release version. In our workflow we use the python-version output to calculate a custom cache key. This breaks i...
Opengraph URL: https://github.com/actions/setup-python/issues/1109
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Python-version output for PyPy isn't unique across different versions","articleBody":"**Description:**\nAt the moment the `python-version` output for PyPy only includes the PyPy release version. In our workflow we use the `python-version` output to calculate a custom cache key. This breaks if the output for different minor version is the same. PyPy itself uses a combination of python version and internal version to identify each release.\n\n| PyPy file name [^1] | `python-version` output | expected output |\n| --- | --- | --- |\n| pypy3.10-v7.3.19-... | pypy7.3.19 | pypy3.10.16-7.3.19 |\n| pypy3.11-v7.3.19-... | pypy7.3.19 | pypy3.11.11-7.3.19 |\n\nhttps://github.com/actions/setup-python/blob/a26af69be951a213d495a4c3e4e4022e16d87065/src/find-pypy.ts#L99\n\nIt would be great if the output could be adjusted to include the python version as well. For it's own caching key, the action already uses a combine version identifier.\n\nhttps://github.com/actions/setup-python/blob/a26af69be951a213d495a4c3e4e4022e16d87065/src/setup-python.ts#L111\n\n--\nAFAICT this also affects `graalpy`. In that case it isn't an issue though as a particular release only supports one minor python version.\n\n**Expected behavior:**\nThe `python-version` output for PyPy contains both the fully resolved python version as well as the resolved PyPy version. E.g.\n```ts\n`pypy${resolvedPythonVersion}-${resolvedPyPyVersion}`\n```\n\n**Actual behavior:**\n```ts\n'pypy' + resolvedPyPyVersion\n```\n\n**Action version:**\nv5.6.0\n\n**Platform:**\n- [x] Ubuntu\n- [x] macOS\n- [x] Windows\n\n**Runner type:**\n- [x] Hosted\n- [ ] Self-hosted\n\n**Tools version:**\nPyPy\n\n**Repro steps:** \n```yaml\n tests:\n name: \"Test ${{ matrix.python-version }}\"\n strategy:\n matrix:\n python-version: [\"3.10\", \"3.11\", \"3.12\", \"pypy-3.10\", \"pypy-3.11\"]\n runs-on: ubuntu-latest\n steps:\n - name: Check out code from GitHub\n uses: actions/checkout@v4.2.2\n - name: Set up Python ${{ matrix.python-version }}\n id: python\n uses: actions/setup-python@v5.6.0\n with:\n python-version: ${{ matrix.python-version }}\n check-latest: true\n - run: echo \"${{ steps.python.outputs.python-version }}\"\n - name: Restore Python venv\n id: cache-venv\n uses: actions/cache@v4.2.3\n with:\n path: venv\n key: \u003e-\n ${{ runner.os }}-${{ runner.arch }}-${{ steps.python.outputs.python-version\n }}-${{ hashFiles('pyproject.toml', 'requirements_test.txt') }}\n - name: Create Python venv\n if: steps.cache-venv.outputs.cache-hit != 'true'\n run: |\n python -m venv venv\n . venv/bin/activate\n pip install -r requirements_test.txt\n pip install .\n - name: Run pytest\n run: |\n . venv/bin/activate\n pip install . --no-deps\n pytest tests/\n```\n\n[^1]: https://downloads.python.org/pypy/versions.json","author":{"url":"https://github.com/cdce8p","@type":"Person","name":"cdce8p"},"datePublished":"2025-05-17T19:14:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/1109/setup-python/issues/1109"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:bccb23f7-ae5b-ae48-29a4-6d932efaa7bc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C948:2DA0A8:A0B9F9:D7D449:6969C21F |
| html-safe-nonce | f4e554af06ea5cc26684f21d96e16df572002cc0979b0fa42716656be24c1537 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTQ4OjJEQTBBODpBMEI5Rjk6RDdENDQ5OjY5NjlDMjFGIiwidmlzaXRvcl9pZCI6IjYzMDAwMzgyMzExODkyMDk2MzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3681bce91ae78e70689f9e7ec26a1ef52a28aca6ad2b77cf05c3e949212d2d4c |
| hovercard-subject-tag | issue:3071006696 |
| github-keyboard-shortcuts | repository,issues,actions,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/actions/setup-python/1109/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b41c6624395376b139257dc83a2688881bf429f7ad2b20b184f4aa0b7f1aebf4/actions/setup-python/issues/1109 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b41c6624395376b139257dc83a2688881bf429f7ad2b20b184f4aa0b7f1aebf4/actions/setup-python/issues/1109 |
| og:image:alt | Description: At the moment the python-version output for PyPy only includes the PyPy release version. In our workflow we use the python-version output to calculate a custom cache key. This breaks i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cdce8p |
| hostname | github.com |
| expected-hostname | github.com |
| None | acedec8b5f975d9e3d494ddd8f949b0b8a0de59d393901e26f73df9dcba80056 |
| turbo-cache-control | no-preview |
| go-import | github.com/actions/setup-python git https://github.com/actions/setup-python.git |
| octolytics-dimension-user_id | 44036562 |
| octolytics-dimension-user_login | actions |
| octolytics-dimension-repository_id | 192625525 |
| octolytics-dimension-repository_nwo | actions/setup-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 192625525 |
| octolytics-dimension-repository_network_root_nwo | actions/setup-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 83c08c21cdda978090dc44364b71aa5bc6dcea79 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width