abatilo / actions-poetry

GitHub Actions for Python projects using poetry
MIT License
430 stars 43 forks source link

PermissionError Installing pycparser #70

Closed FuhuXia closed 9 months ago

FuhuXia commented 9 months ago

Seeing PermissionError when install poetry-plugin-export with python 3.10 and poetry 1.7.1

Snippet from the job:

...
  jobs:
    deploy-development:
      name: deploy (development)
      runs-on: ubuntu-latest
      steps:
        - name: Install Poetry
          uses: abatilo/actions-poetry@v2
          with:
            poetry-version: "1.7.1"
            poetry-plugins: "poetry-plugin-export"

Error in the log:

  ...
  Run ALL_PLUGINS=$(echo "poetry-plugin-export")
  ALL_PLUGINS=$(echo "poetry-plugin-export")
  for PLUGIN in $ALL_PLUGINS; do
    poetry self add $PLUGIN
  done
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    POETRY_VERSION: 1.7.1

Using version ^1.6.0 for poetry-plugin-export
Updating dependencies
Resolving dependencies...
Package operations: 2 installs, 36 updates, 0 removals
  • Installing pycparser (2.21)
  PermissionError
  [Errno 13] Permission denied: '/usr/local/lib/python3.10/dist-packages/pycparser'
at /usr/lib/python3.10/pathlib.py:1175 in mkdir
      1171│         """
      1172│         Create a new directory at this given path.
      1173│         """
      1174│         try:
      1175│             self._accessor.mkdir(self, mode)
      1176│         except FileNotFoundError:
      1177│             if not parents or self.parent == self:
      1178│                 raise
      1179│             self.parent.mkdir(parents=True, exist_ok=True)
Cannot install pycparser.
Error: Process completed with exit code 1.
abatilo commented 9 months ago

@xSAVIKx Have you seen this before?

xSAVIKx commented 9 months ago

Hey @abatilo. No, not really. I'm using this plugin functionality in dozen of places and AFAIK it works just fine.

The only difference is that I'm not using built-in Python and always setting up Python via a respective action

abatilo commented 9 months ago

That makes a lot of sense actually @xSAVIKx. @FuhuXia could you try that?

FuhuXia commented 9 months ago

Confirmed, it works with python 3.10 added via actions/setup-python@v5. Thanks.

...
  jobs:
    deploy-development:
      name: deploy (development)
      runs-on: ubuntu-latest
      steps:
      - uses: actions/setup-python@v5
        with:
          python-version: '3.10' 
      - name: Install Poetry
        uses: abatilo/actions-poetry@v2
        with:
          poetry-version: ${{ env.POETRY_VERSION }}
          poetry-plugins: "poetry-plugin-export"

Result: poetry-plugin-export is installed.

Run ALL_PLUGINS=$(echo "poetry-plugin-export")
  ALL_PLUGINS=$(echo "poetry-plugin-export")
  for PLUGIN in $ALL_PLUGINS; do
    poetry self add $PLUGIN
  done
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    PY_VERSION: 3.10
    POETRY_VERSION: 1.7.1
    pythonLocation: /opt/hostedtoolcache/Python/3.10.13/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.10.13/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.13/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.13/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.13/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.13/x64/lib
Using version ^1.6.0 for poetry-plugin-export

Updating dependencies
Resolving dependencies... 

No dependencies to install or update

Writing lock file