Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support debian 12 #556

Closed
wants to merge 1 commit into from
Closed

Support debian 12 #556

wants to merge 1 commit into from

Conversation

suppHorter
Copy link

@suppHorter suppHorter commented Jan 10, 2024

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:

  • python3-full
  • python3-pip
root@f676d2dc4a1c:/_setup# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

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
Copy link
Author

Duplicate of #558?

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

@EnricoMi
Copy link
Owner

Can you test #558 in your Debian 12 environment?

uses: EnricoMi/publish-unit-test-result-action/composite@check-venv-installed

@suppHorter
Copy link
Author

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
Copy link
Owner

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

@suppHorter
Copy link
Author

Hi @EnricoMi,

I could successfully test it. ✅

Thanks for your effort.

@suppHorter
Copy link
Author

Hi @EnricoMi,

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

@EnricoMi
Copy link
Owner

EnricoMi commented Feb 3, 2024

Fixed in #558. Thanks for reporting!

@EnricoMi EnricoMi closed this Feb 3, 2024
@EnricoMi
Copy link
Owner

EnricoMi commented Feb 3, 2024

This has just been released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants