Giter Site home page Giter Site logo

Comments (29)

fritz-astronomer avatar fritz-astronomer commented on June 11, 2024 4

Also seeing this issue ๐Ÿ‘

from install-poetry.

deronnax avatar deronnax commented on June 11, 2024 3

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.

from install-poetry.

deronnax avatar deronnax commented on June 11, 2024 2

@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

from install-poetry.

miigotu avatar miigotu commented on June 11, 2024 2

#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

from install-poetry.

Musaefendic avatar Musaefendic commented on June 11, 2024 1

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 ๏ฟฝ[36;1mpoetry install --no-interaction๏ฟฝ[0m
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?

from install-poetry.

sTomerG avatar sTomerG commented on June 11, 2024 1

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 }}

from install-poetry.

sondrelg avatar sondrelg commented on June 11, 2024

Would you mind sharing your workflow configuration (just the install-poetry step)?

I don't think it breaks the action. AFAICT lockfiles generated by < 1.2 are incompatible with 1.2 and vice versa, so if your lockfile was generated with 1.1.X you need to specify a 1.1.X version in your action run.

    - uses: snok/install-poetry@v1
      with:
        version: 1.1.14

Should work, while

    - uses: snok/install-poetry@v1

Will not.

Does that make sense, or do you think it's broken for 1.2 with 1.2 lockfiles?

from install-poetry.

deronnax avatar deronnax commented on June 11, 2024

Hello :)
I pasted the output of the action (and then you have the action's configuration as well). It's the poetry command itself that is not found. See the original message.

from install-poetry.

sondrelg avatar sondrelg commented on June 11, 2024

Ah yes. And I see you've specified latest as the version. Does it work if you change it to 1.1.14?

from install-poetry.

deronnax avatar deronnax commented on June 11, 2024

Yes

from install-poetry.

sondrelg avatar sondrelg commented on June 11, 2024

Ok great. If you want to use 1.2.0 in your github actions run you first need to upgrade Poetry to 1.2.0 locally, then run poetry update or poetry lock --no-update to make the file compatible with 1.2.0. After doing that, upgrading to 1.2.0 or latest in the action should work again.

from install-poetry.

deronnax avatar deronnax commented on June 11, 2024

Hello. You got it. Sorry I should not have cut the Github Actions output: the error we get is poetry: command not found. You can see this error (somewhat hidden) in GHA output. I think Poetry 1.2.0 changed the location where poetry is installed.

from install-poetry.

sondrelg avatar sondrelg commented on June 11, 2024

I see. That's unfortunate if that's the case. I'm not able to look at this right now, but PRs are welcome ๐Ÿ‘

from install-poetry.

fritz-astronomer avatar fritz-astronomer commented on June 11, 2024

#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 ๐Ÿ˜ƒ

from install-poetry.

sondrelg avatar sondrelg commented on June 11, 2024

I added two comments in the PR, but would be good to get your take too @deronnax. I tried updating two projects to Poetry version 1.2.0, and neither one had any problems running the action. Just to understand what is broken, what is different between these two workflows and yours?

from install-poetry.

fritz-astronomer avatar fritz-astronomer commented on June 11, 2024

Discussion continued in #90

from install-poetry.

ronlut avatar ronlut commented on June 11, 2024

To avoid the brownout, add the following to the poetry install step until you upgrade to 1.2.0

env:
  GET_POETRY_IGNORE_DEPRECATION: 1

from install-poetry.

amirhessam88 avatar amirhessam88 commented on June 11, 2024

I guess you gotta make sure to have

[build-system]
requires = ["poetry-core>=1.1.0"]

More on --> https://github.com/python-poetry/poetry/blob/master/pyproject.toml#L47

from install-poetry.

amirhessam88 avatar amirhessam88 commented on June 11, 2024

@Musaefendic is it your intention not using poetry v1.2.1 ? I can see this https://github.com/Musaefendic/icao-emissions/blob/96d41895570a1aefe21cab13f32f906f44d6f6ab/.github/workflows/tests.yml#L48
You can drop the version and the action will automatically setup the latest version

from install-poetry.

Musaefendic avatar Musaefendic commented on June 11, 2024

good catch! It is an error after several unsuccessful attempts.
I just removed the line version: 1.1.14 but the result is the same.

โœ… windows-latest and ubuntu-latest
โŒ macos-latest

i got the same error:

Run poetry install --no-interaction
[...]
/Users/runner/work/_temp/6c346071-2b8c-41b1-b4f2-75377cb405b1.sh: line 1: poetry: command not found
Error: Process completed with exit code 127.

from install-poetry.

miigotu avatar miigotu commented on June 11, 2024

I wonder if your action is caching a really old version 1, and it's not using the newest version.

Maybe try uses: snok/[email protected]

You can also try activating it manually

from install-poetry.

miigotu avatar miigotu commented on June 11, 2024

@Musaefendic also, restore venv cache BEFORE installing poetry.

from install-poetry.

miigotu avatar miigotu commented on June 11, 2024

And if it still doesn't work I'd start with this after installing poetry

      - name: Check environment 
        run: |
          echo $PATH
          echo $VENV
          ls ./local/bin

from install-poetry.

miigotu avatar miigotu commented on June 11, 2024

And I'm most sure snok/install-poetry@lint could work, because he added the path to the final commands.

from install-poetry.

Musaefendic avatar Musaefendic commented on June 11, 2024

And if it still doesn't work I'd start with this after installing poetry

      - name: Check environment 
        run: |
          echo $PATH
          echo $VENV
          ls ./local/bin
/Users/runner/.local//bin:/Users/runner/hostedtoolcache/Python/3.9.10/x64/bin:/Users/runner/hostedtoolcache/Python/3.9.10/x64:/usr/local/lib/ruby/gems/2.7.0/bin:/usr/local/opt/[email protected]/bin:/usr/local/opt/pipx_bin:/Users/runner/.cargo/bin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/runner/bin:/Users/runner/.yarn/bin:/Users/runner/Library/Android/sdk/tools:/Users/runner/Library/Android/sdk/platform-tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/bin:/bin:/usr/sbin:/sbin:/Users/runner/.dotnet/tools:/Users/runner/.ghcup/bin:/Users/runner/hostedtoolcache/stack/2.9.1/x64

.venv/bin/activate

ls: ./local/bin: No such file or directory
Error: Process completed with exit code 1.

I wonder if your action is caching a really old version 1, and it's not using the newest version.

good intuition! if I delete Load cached poetry installation, all workflows pass โœ…
any idea how to purge the cache?

from install-poetry.

Musaefendic avatar Musaefendic commented on June 11, 2024

To clear the GH Actions cache, it's a new feature since June 22. See this SO post https://stackoverflow.com/a/64819132

Clearing the cache

curl \
    -H "Accept: application/vnd.github.v3+json" \
    -H "Authorization: token *********************" \
    https://api.github.com/repos/Musaefendic/icao-emissions/actions/caches
{
  "total_count": 0,
  "actions_caches": [

  ]
}

1st CI Run after clearing the cache.

Link to my tests.yml

  • โœ… ubuntu-latest
  • โœ… macos-latest
  • โœ… windows-latest

cache after this CI run

curl \
    -H "Accept: application/vnd.github.v3+json" \
    -H "Authorization: token ****************" \
    https://api.github.com/repos/Musaefendic/icao-emissions/actions/caches
{
  "total_count": 5,
  "actions_caches": [
    {
      "id": 21,
      "ref": "refs/heads/master",
      "key": "venv-macOS-3.9.10-7f3e4de67ec2fafad1743c550f0d8aaf4038b5f0f03ecfe5275d285833296cbf",
      "version": "25e65b70d167147605b4332eb57b6d34df8e0303b88c4de252efb18cf3ed148a",
      "last_accessed_at": "2022-09-29T21:31:08.286666700Z",
      "created_at": "2022-09-29T21:31:08.286666700Z",
      "size_in_bytes": 71408887
    },
    {
      "id": 20,
      "ref": "refs/heads/master",
      "key": "poetry-0",
      "version": "d6b93696bc837862e84764c8431f7c282393336a702ec638c820588088bfd7a1",
      "last_accessed_at": "2022-09-29T21:30:09.980000000Z",
      "created_at": "2022-09-29T21:30:09.980000000Z",
      "size_in_bytes": 30
    },
    {
      "id": 19,
      "ref": "refs/heads/master",
      "key": "venv-Windows-3.9.10-14a2a15fefb761fe78d797839a035d718998d5ff92247101add1124f1e5af187",
      "version": "519c93c80eb6dc7871185acd9844f0af47c509ad7b0399902b51e465753dba51",
      "last_accessed_at": "2022-09-29T21:29:51.203333300Z",
      "created_at": "2022-09-29T21:29:51.203333300Z",
      "size_in_bytes": 75356150
    },
    {
      "id": 18,
      "ref": "refs/heads/master",
      "key": "poetry-0",
      "version": "f4b5713a4657ae30a7c2804b2ad5dbc790b3736f71a74a904bcab1f478b0ed29",
      "last_accessed_at": "2022-09-29T21:27:04.993333300Z",
      "created_at": "2022-09-29T21:27:04.993333300Z",
      "size_in_bytes": 25628232
    },
    {
      "id": 17,
      "ref": "refs/heads/master",
      "key": "venv-Linux-3.9.10-7f3e4de67ec2fafad1743c550f0d8aaf4038b5f0f03ecfe5275d285833296cbf",
      "version": "25e65b70d167147605b4332eb57b6d34df8e0303b88c4de252efb18cf3ed148a",
      "last_accessed_at": "2022-09-29T21:27:00.680000000Z",
      "created_at": "2022-09-29T21:27:00.680000000Z",
      "size_in_bytes": 82591676
    }
  ]
}

2nd CI RUN

same tests.yml

  • โœ… ubuntu-latest
  • โŒ macos-latest -> Error: Process completed with exit code 127.
  • โœ… windows-latest

from install-poetry.

sondrelg avatar sondrelg commented on June 11, 2024

I'm on holidays almost without internet for a few days, but should have time to review a PR if anyone has time to investigate ๐Ÿ‘ Otherwise, I'll be happy to look at this on Tuesday ๐Ÿ™‚

from install-poetry.

miigotu avatar miigotu commented on June 11, 2024

And if it still doesn't work I'd start with this after installing poetry

      - name: Check environment 
        run: |
          echo $PATH
          echo $VENV
          ls ./local/bin
/Users/runner/.local//bin:/Users/runner/hostedtoolcache/Python/3.9.10/x64/bin:/Users/runner/hostedtoolcache/Python/3.9.10/x64:/usr/local/lib/ruby/gems/2.7.0/bin:/usr/local/opt/[email protected]/bin:/usr/local/opt/pipx_bin:/Users/runner/.cargo/bin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/runner/bin:/Users/runner/.yarn/bin:/Users/runner/Library/Android/sdk/tools:/Users/runner/Library/Android/sdk/platform-tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/bin:/bin:/usr/sbin:/sbin:/Users/runner/.dotnet/tools:/Users/runner/.ghcup/bin:/Users/runner/hostedtoolcache/stack/2.9.1/x64

.venv/bin/activate

ls: ./local/bin: No such file or directory
Error: Process completed with exit code 1.

I wonder if your action is caching a really old version 1, and it's not using the newest version.

good intuition! if I delete Load cached poetry installation, all workflows pass โœ…
any idea how to purge the cache?

You could always use a different cache key or add a restore key that's different than what it's using now. Poetry version changed but your pyproject.toml didn't, so the next change to your pyprotect.toml would have done it also.

from install-poetry.

sTomerG avatar sTomerG commented on June 11, 2024

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```

from install-poetry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.