install-poetry: install-poetry breaks with Poetry 1.2.0

Poetry 1.2.0 changes a lot of things about how path and virtualenvs are handled, and it breaks install-poetry:

▶ Run snok/install-poetry@v1
  with:
    virtualenvs-create: true
    virtualenvs-in-project: true
    installer-parallel: true
    version: latest
    virtualenvs-path: {cache-dir}/virtualenvs
  env:
    DJANGO_ENV: LOCAL
    pythonLocation: /opt/hostedtoolcache/Python/3.6.15/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.6.15/x64/lib
Run $GITHUB_ACTION_PATH/main.sh
  $GITHUB_ACTION_PATH/main.sh
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    DJANGO_ENV: LOCAL
    pythonLocation: /opt/hostedtoolcache/Python/3.6.15/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.6.15/x64/lib
    VERSION: latest
    VIRTUALENVS_CREATE: true
    VIRTUALENVS_IN_PROJECT: true
    VIRTUALENVS_PATH: {cache-dir}/virtualenvs
    INSTALLER_PARALLEL: true
    INSTALLATION_ARGUMENTS: 

Setting Poetry installation path as /home/runner/.local/

Installing Poetry 👷

Retrieving Poetry metadata

# Welcome to Poetry!

This will download and install the latest version of Poetry,
a dependency and package manager for Python.

It will add the `poetry` command to Poetry's bin directory, located at:

/home/runner/.local/bin

You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.

Installing Poetry (1.[2](https://github.com/critizr/critizr-django-1.7/runs/8108219212?check_suite_focus=true#step:7:2).0)
Installing Poetry (1.2.0): Creating environment
Installing Poetry (1.2.0): Installing Poetry
Installing Poetry (1.2.0): Creating script
Installing Poetry (1.2.0): Done

Poetry (1.2.0) is installed now. Great!

You can test that everything is set up by executing:

`poetry --version`

/home/runner/work/_actions/snok/install-poetry/v1/main.sh: line [3](https://github.com/critizr/critizr-django-1.7/runs/8108219212?check_suite_focus=true#step:7:3)3: poetry: command not found
/home/runner/work/_actions/snok/install-poetry/v1/main.sh: line 3[4](https://github.com/critizr/critizr-django-1.7/runs/8108219212?check_suite_focus=true#step:7:4): poetry: command not found
/home/runner/work/_actions/snok/install-poetry/v1/main.sh: line 3[5](https://github.com/critizr/critizr-django-1.7/runs/8108219212?check_suite_focus=true#step:7:5): poetry: command not found
/home/runner/work/_actions/snok/install-poetry/v1/main.sh: line 3[7](https://github.com/critizr/critizr-django-1.7/runs/8108219212?check_suite_focus=true#step:7:7): poetry: command not found

Installation completed. Configuring settings 🛠

Done ✅

If you are creating a venv in your project, you can activate it by running 'source .venv/bin/activate'. If you're running this in an OS matrix, you can use 'source $VENV' instead, as an OS agnostic option

▶ Run poetry install --no-interaction --no-root
/home/runner/work/_temp/63f8c552-7bf4-4d02-bd7b-8b02d[9](https://github.com/critizr/critizr-django-1.7/runs/8109330298?check_suite_focus=true#step:9:10)c8b5c0.sh: line 1: poetry: command not found
Error: Process completed with exit code 127.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 6
  • Comments: 29 (6 by maintainers)

Commits related to this issue

Most upvoted comments

Also seeing this issue 👍

No worries. I will make a PR if I manage to find out what broke. Let’s not close this issue as I assume many people will come here to report the issue.

#90 Attempting a fix here, ~unsure how to test this in a Github Action~

edit:// this seems to fix it - there was a trailing / in the path, by accident. I have a separate issue now of Poetry 1.2.0 dropping support for Python 3.6, but that’s unrelated smiley

https://endoflife.date/python

Projects are dropping python3.6 because it is no longer considered secure as end of life was 8 months ago and it no longer receives security fixes. Tools and libraries dropping support forces OS distributions to release newer, supported versions of python on their platform. This is a good thing, because it is intended to result in a more secure internet and better safety for users’ machines.

image

@sondrelg no clue, our workflow is pretty standard, my bet is that it’s all related to the dropping of Python 3.6 from Poetry 1.2.0. We will pin the Poetry version and wait until we move to the next python version to see if it reproduces, which I bet it won’t.

In between, thank you very much for your time

I’m having the exact same issue (exit code 127, only on macOS-latest) with the following workflow. Is there something I should change?

  push:
    branches: [main]
  pull_request:

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        python-version: ["3.10"]
        os: [ubuntu-latest, macOS-latest, windows-latest]
    env:
      POETRY_VIRTUALENVS_IN_PROJECT: true
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}

      - name: cache poetry install
        uses: actions/cache@v2
        with:
          path: ~/.local
          key: poetry-1.2.1-0

      - uses: snok/install-poetry@v1
        with:
          version: 1.2.1
          virtualenvs-create: true
          virtualenvs-in-project: true

      #  Cache your dependencies (i.e. all the stuff in your `pyproject.toml`)
      - name: cache venv
        uses: actions/cache@v2
        with:
          path: .venv
          key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
      - run: poetry install --no-interaction --no-root
        if: steps.cache-deps.outputs.cache-hit != 'true'
      - run: poetry install --no-interaction
      - run: poetry run flake8 src/ tests/
      - run: poetry run pytest```

fixed it by adding

env:
  POETRY_VERSION: 1.2.1

And replacing

key: poetry-1.2.1-0

with

key: poetry-cache-${{ runner.os }}-${{ matrix.python-version }}-${{ env.POETRY_VERSION }}

Same issue here, but only with macos-latest ❌ On the other hand no problem with windows-latest and ubuntu-latest

Here is the link to the yml file: https://github.com/Musaefendic/icao-emissions/blob/96d41895570a1aefe21cab13f32f906f44d6f6ab/.github/workflows/tests.yml

2022-09-29T16:05:45.3245480Z ##[group]Run poetry install --no-interaction
2022-09-29T16:05:45.3245930Z poetry install --no-interaction
2022-09-29T16:05:45.3754580Z shell: /bin/bash --noprofile --norc -e -o pipefail {0}
2022-09-29T16:05:45.3754920Z env:
2022-09-29T16:05:45.3755490Z   pythonLocation: /Users/runner/hostedtoolcache/Python/3.9.10/x64
2022-09-29T16:05:45.3755920Z   PKG_CONFIG_PATH: /Users/runner/hostedtoolcache/Python/3.9.10/x64/lib/pkgconfig
2022-09-29T16:05:45.3756330Z   Python_ROOT_DIR: /Users/runner/hostedtoolcache/Python/3.9.10/x64
2022-09-29T16:05:45.3757220Z   Python2_ROOT_DIR: /Users/runner/hostedtoolcache/Python/3.9.10/x64
2022-09-29T16:05:45.3757620Z   Python3_ROOT_DIR: /Users/runner/hostedtoolcache/Python/3.9.10/x64
2022-09-29T16:05:45.3757940Z   VENV: .venv/bin/activate
2022-09-29T16:05:45.3758180Z ##[endgroup]
2022-09-29T16:05:45.4574200Z /Users/runner/work/_temp/7e911813-9a38-4bc5-8835-86f3f94d1643.sh: line 1: poetry: command not found
2022-09-29T16:05:45.4602330Z ##[error]Process completed with exit code 127.

did I set up my .yml wrong?