Github actions sequence with ubuntu latest do not allow poetry installation
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
+1
y'all can replace this action in Ubuntu runners with:
pipx install poetry
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
@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.
Very sorry about that @mmontesi. I've fixed this as a part of #80
Thanks @abatilo , really appreciated.