EnricoMi / publish-unit-test-result-action

GitHub Action to publish unit test results on GitHub
Apache License 2.0
625 stars 183 forks source link

Support debian 12 #556

Closed suppHorter closed 9 months ago

suppHorter commented 10 months ago

Hi @EnricoMi

on debian12 pip outside of virtual environments is not supported anymore, so the first pip install call in the composite/action.yml fails. As far as I found out only python3 3.11 is available on debian12

Setup

docker image: debian:bookworm-slim

installed packages:

Error

received error message:

root@172b694a026a:/_setup# python3 -m pip install virtualenv
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.11/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.

Proposal

python3-virtualenv has to be preinstalled on debian12 so the virtualenv is created and the pip commands are executed inside of it. This also should be backwards compatible so users without preinstalled python3-virtualenv can still use it in prior versions.

apt-get update
apt-get install -y python3-virtualenv
python3 -m virtualenv enricomi-publish-action-venv
source enricomi-publish-action-venv/bin/activate

(enricomi-publish-action-venv)> python3 -m pip wheel # pip works in venv

Thanks for considering this or any better approach to fix this, Max

suppHorter commented 10 months ago

Duplicate of #558?

Feel free to close this if tracked in the other issue.

EnricoMi commented 10 months ago

Can you test #558 in your Debian 12 environment?

uses: EnricoMi/publish-unit-test-result-action/composite@check-venv-installed
suppHorter commented 10 months ago

Hi @EnricoMi,

worked on the first try. 🎉 We will now wait for the new release to properly adress the version instead of the commit / branch.

Thank you so much for the fast response and integration.

EnricoMi commented 10 months ago

@suppHorter I have modified the check-venv-installed branch, can you test that one again to see it still works for you?

suppHorter commented 10 months ago

Hi @EnricoMi,

I could successfully test it. ✅

Thanks for your effort.

suppHorter commented 10 months ago

Hi @EnricoMi,

do you have a rough estimation when we can expect the new release?

EnricoMi commented 9 months ago

Fixed in #558. Thanks for reporting!

EnricoMi commented 9 months ago

This has just been released.