gabrielfalcao / pyenv-action

Enables pyenv within your github actions workflow
MIT License
39 stars 19 forks source link

Specifying major.minor Python versions with no patch results in error #402

Open sonotley opened 1 year ago

sonotley commented 1 year ago

I have this step based on the docs, which I originally used with version 11. I hadn't run it for a while (about 5 months) and then when I ran it this week it threw an error (see below). I updated to v14 and didn't make any difference. Looking at the logs the installation of Python is succeeding, but after that something is trying to open the version directory and instead of using the full x.y.z version it is just using x.y. I tested this by specifying 3.11.3 and 3.10.11 instead, and that worked. However I'd rather not have to update my action for patch releases.

Step

jobs:

  build:
    runs-on: ubuntu-latest
    ...
    steps:
    - name: setup pyenv
      uses: "gabrielfalcao/pyenv-action@v14"
      with:
        default: 3.11
        versions: 3.10, 3.11

Error

Run gabrielfalcao/pyenv-action@v14
  with:
    default: 3.11
    versions: 3.10, 3.11
  env:
    PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring
downloading https://github.com/pyenv/pyenv/archive/v[2](https://github.com/sonotley/customer-explorer/actions/runs/5415839803/jobs/9844718880#step:2:2).[3](https://github.com/sonotley/customer-explorer/actions/runs/5415839803/jobs/9844718880#step:2:3).17.zip
/usr/bin/unzip -o -q /opt/hostedtoolcache/pyenv-archive.zip/2.3.17/x6[4](https://github.com/sonotley/customer-explorer/actions/runs/5415839803/jobs/9844718880#step:2:4)/pyenv-archive.zip
Extracted /opt/hostedtoolcache/pyenv-archive.zip/2.3.17/x64/pyenv-archive.zip to /home/runner/work/_temp/7f030[5](https://github.com/sonotley/customer-explorer/actions/runs/5415839803/jobs/9844718880#step:2:5)4d-5d51-4c[6](https://github.com/sonotley/customer-explorer/actions/runs/5415839803/jobs/9844718880#step:2:6)8-9e40-0f902969fbd0.
archive_path /opt/hostedtoolcache/pyenv-archive.zip/2.3.1[7](https://github.com/sonotley/customer-explorer/actions/runs/5415839803/jobs/9844718880#step:2:8)/x64/pyenv-archive.zip
pyenv_root /opt/hostedtoolcache/pyenv_root/2.3.17/x64
export PYENV_ROOT="/opt/hostedtoolcache/pyenv_root/2.3.17/x64"
Patched PATH with "/opt/hostedtoolcache/pyenv_root/2.3.17/x64/bin"
/opt/hostedtoolcache/pyenv_root/2.3.17/x64/bin/pyenv install 3.10
/opt/hostedtoolcache/pyenv_root/2.3.17/x64/bin/pyenv install 3.11
Downloading Python-3.11.3.tar.xz...
-> https://www.python.org/ftp/python/3.11.3/Python-3.11.3.tar.xz
Downloading Python-3.10.11.tar.xz...
-> https://www.python.org/ftp/python/3.10.11/Python-3.10.11.tar.xz
Installing Python-3.10.11...
Installing Python-3.11.3...
Installed Python-3.10.11 to /opt/hostedtoolcache/pyenv_root/2.3.17/x64/versions/3.10.11
Sucessfully installed python 3.10
node:fs:1551
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, stat '/opt/hostedtoolcache/pyenv_root/2.3.17/x64/versions/3.10'
    at Object.statSync (node:fs:1551:3)
    at Object.<anonymous> (/home/runner/work/_actions/gabrielfalcao/pyenv-action/v14/dist/index.js:4[8](https://github.com/sonotley/customer-explorer/actions/runs/5415839803/jobs/9844718880#step:2:9)[9](https://github.com/sonotley/customer-explorer/actions/runs/5415839803/jobs/9844718880#step:2:10)8:17)
    at Generator.next (<anonymous>)
    at /home/runner/work/_actions/gabrielfalcao/pyenv-action/v14/dist/index.js:4520:71
    at new Promise (<anonymous>)
    at __webpack_modules__.7784.__awaiter (/home/runner/work/_actions/gabrielfalcao/pyenv-action/v14/dist/index.js:4516:12)
    at Object.cacheDir (/home/runner/work/_actions/gabrielfalcao/pyenv-action/v14/dist/index.js:4893:12)
    at /home/runner/work/_actions/gabrielfalcao/pyenv-action/v14/dist/index.js:13708:24
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  errno: -2,
  syscall: 'stat',
  code: 'ENOENT',
  path: '/opt/hostedtoolcache/pyenv_root/2.3.17/x64/versions/3.[10](https://github.com/sonotley/customer-explorer/actions/runs/5415839803/jobs/9844718880#step:2:11)'
}