Gr1N / setup-poetry

Set up your GitHub Actions workflow with a specific version of Poetry
MIT License
87 stars 14 forks source link

Poetry fails during install after setup in GitHub Actions #25

Closed HenriqueAJNB closed 1 year ago

HenriqueAJNB commented 3 years ago

I'm facing a problem with Poetry and GitHub actions in the last days. Maybe because Poetry has an updated version.

Information

I'm using the following .yml file for the CI/CD

jobs:
  execute-linters:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Pyton 3.9
        uses: actions/setup-python@v2
        with:
          python-version: 3.9

      - name: Poetry
        uses: Gr1N/setup-poetry@v7

      - name: Dependencies
        run: poetry install
...

Whenever it runs, during the Dependencies job, it fails and I've got the following error

• Installing py (1.10.0)

  EnvCommandError

  Command ['/home/runner/work/ds-gdem-pvso/ds-gdem-pvso/.venv/bin/pip', 'install', '--no-deps', '/home/runner/.cache/pypoetry/artifacts/c8/3a/b1/6d8182aff6a688801f32ca473f2ba55ecb83446a84cf3d1afad18800e0/ibm_db-3.0.4.tar.gz'] errored with the following return code 1, and output: 
  Processing /home/runner/.cache/pypoetry/artifacts/c8/3a/b1/6d8182aff6a688801f32ca473f2ba55ecb83446a84cf3d1afad18800e0/ibm_db-3.0.4.tar.gz
      ERROR: Command errored out with exit status 1:
       command: /home/runner/work/ds-gdem-pvso/ds-gdem-pvso/.venv/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-c_nfk704/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-c_nfk704/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-9hi5cw5y
           cwd: /tmp/pip-req-build-c_nfk704/
      Complete output (3 lines):
      Detected 64-bit Python
      Downloading https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz
      error in ibm_db setup command: use_2to3 is invalid.
      ----------------------------------------
  WARNING: Discarding file:///home/runner/.cache/pypoetry/artifacts/c8/3a/b1/6d8182aff6a688801f32ca473f2ba55ecb83446a84cf3d1afad18800e0/ibm_db-3.0.4.tar.gz. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

  at ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/utils/env.py:1180 in _run
      1176│                 output = subprocess.check_output(
      1177│                     cmd, stderr=subprocess.STDOUT, **kwargs
      1178│                 )
      1179│         except CalledProcessError as e:
    → 1180│             raise EnvCommandError(e, input=input_)
      1181│ 
      1182│         return decode(output)
      1183│ 
      1184│     def execute(self, bin, *args, **kwargs):

  • Installing pyarrow (4.0.1)
  • Installing regex (2021.8.28)
  • Installing scikit-learn (0.24.2)
  • Installing toml (0.10.2)
  • Installing tomli (1.2.1)
  • Installing tqdm (4.62.3)
  • Installing typing-inspect (0.7.1)
  • Installing wrapt (1.12.1)
Error: Process completed with exit code 1.

Attempts

At first I was using the Gr1N/setup-poetry@v4 and I notice that it was outdated. I've tried to update it to Gr1N/setup-poetry@v7, but didn't work.

I also received this Warning: The lock file is not up to date with the latest changes in pyproject.toml. You may be getting outdated dependencies. Run update to update them.. I've tried to delete poetry.lock and run poetry update to generate a new one, no success at all.

fabiogallotti commented 3 years ago

Hello @HenriqueAJNB, I had a similar issue, I solved using Poetry version 1.1.10. Give it a try!

HenriqueAJNB commented 3 years ago

Hello @HenriqueAJNB, I had a similar issue, I solved using Poetry version 1.1.10. Give it a try!

@fabiogallotti you installed in your local computer and then pushed to run the CI/CD? I ran the setup poetry using Gr1N/setup-poetry@v7. Is there a way to specify the poetry version?

Maybe using the following code in .yml file?

- name: Poetry
   uses: Gr1N/setup-poetry@v7
   with:
     poetry: 1.1.10
fabiogallotti commented 3 years ago

Yes @HenriqueAJNB, you can specify the poetry version like this:

uses: Gr1N/setup-poetry@v7
with:
  poetry-version: 1.1.10
HenriqueAJNB commented 3 years ago

Tried to run with poetry 1.1.10, same error. It seems to be some cache saved at GitHub Actions server that is blocking my CI/CD to run...

amotl commented 3 years ago

Hi there,

maybe it is not directly related, but nevertheless I wanted to report it here. At [1], we have been tripped by the error outlined at https://github.com/python-poetry/poetry/issues/4056.

After upgrading to Gr1N/setup-poetry@v7 and poetry-version: 1.1.11 (https://github.com/daq-tools/wireviz-web/commit/88db933), everything went back to normal.

Thanks, Nikita!

With kind regards, Andreas.

[1] https://github.com/daq-tools/wireviz-web/runs/3977875929