actions-poetry icon indicating copy to clipboard operation
actions-poetry copied to clipboard

Github actions sequence with ubuntu latest do not allow poetry installation

Open alexsoaresilva opened this issue 1 year ago • 6 comments

Today (Otc 14) a PR raised in my company's org triggered the following error:

Run abatilo/actions-poetry@v2
Run pip install -U poetry
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.
    
    See /usr/share/doc/python3.12/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

Now all PRs on python repos that use this action are failing with the same error.

the sequence of github actions that lead to running actions-poetry v2:

    name: Poetry Build Pipeline
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install Python
        uses: actions/setup-python@v5
        with:
          python-version-file: '.python-version'

      - name: Install Poetry
        uses: abatilo/actions-poetry@v2

alexsoaresilva avatar Oct 14 '24 20:10 alexsoaresilva

+1

yaoice avatar Oct 15 '24 08:10 yaoice

y'all can replace this action in Ubuntu runners with:

pipx install poetry

funkyfuture avatar Oct 16 '24 11:10 funkyfuture

y'all can replace this action in Ubuntu runners with:

pipx install poetry

I had a problem (whether or not using this GHA action) on the ubuntu-24.04 runner that poetry on the path would be an older version pre-installed on the runner.

Previously my CI was:

  - name: Install Poetry
    uses: abatilo/actions-poetry@v3
    with:
      poetry-version: 1.5.1

Now:

  - name: Install Poetry
    shell: bash
    run: |
      pipx install poetry==1.8.4  --python python3.9
      echo $PIPX_BIN_DIR >> $GITHUB_PATH

ShedPlant avatar Oct 21 '24 10:10 ShedPlant

@abatilo FYI, it looks like you re-tagged v2 from master, so v2 is now aligned with v3 and it broke my self-hosted runners. I had to stick to v2.4.0 to make it work again.

mmontesi avatar Oct 28 '24 17:10 mmontesi

Very sorry about that @mmontesi. I've fixed this as a part of #80

abatilo avatar Oct 28 '24 17:10 abatilo

Thanks @abatilo , really appreciated.

mmontesi avatar Oct 29 '24 08:10 mmontesi