-
Notifications
You must be signed in to change notification settings - Fork 58
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
CI: Install python3-build & add --break-system-packages for Localstripe #234
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this! Among the various solutions, this one is simple and efficient. We can always switch to another in the future.
@@ -41,9 +41,9 @@ jobs: | |||
uses: actions/setup-python@v4 | |||
with: | |||
python-version: ${{ matrix.pyver }} | |||
- run: pip install 'pip >=23' build | |||
- run: sudo apt install python3-build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is sudo
really needed? I'm wondering whether this container is already run as root.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested without and the error message said that I wasn't root, so it's required sadly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the exact error message:
Run apt install python3-build
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
Error: Process completed with exit code 100.
GitHub is rolling out `ubuntu-24.04` as the new `ubuntu-latest` on GitHub Actions[^1]. Previously it was `ubuntu-22.04`. There are many small breaking changes that people are complaining about in this update[^2]. Localstripe is impacted by the fact that `pip` now fails on installing a paquet system-wide with the following error: ``` 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. ``` There are multiple solutions to this as proposed in the error message: - Use `sudo apt install python3-...` - Use a venv with `python -m venv venv` - Use a venv with `pipx` - Use the `pip` option `--break-system-packages` - Use `ubuntu-22.04` instead of `ubuntu-latest` For the package `build`, `python3-build` exists, so let's use it. For `localstripe-*.tar.gz`, as we already are in an isolated container where breaking Python is meaningless, and as there is nothing in that container that might actually break when we install Localstripe, let's just use the option `--break-system-packages`. After this commit, the CI works again with `ubuntu-latest`. [^1]: https://github.blog/changelog/2024-09-25-actions-new-images-and-ubuntu-latest-changes/ [^2]: actions/runner-images#10636
This reverts commit 1ad01ad "CI: Install python3-build & add --break-system-packages for Localstripe", merged 5 days ago. Since then, the CI broke again, with errors like: $ python -m build RuntimeError: Virtual environment creation failed, executable /tmp/build-…/local/bin/python missing I found that using our previous `pip install` commands worked. GitHub or Ubuntu maintainers probably fixed the inconveniences described by Hoël at #234.
This reverts commit 1ad01ad "CI: Install python3-build & add --break-system-packages for Localstripe", merged 5 days ago. Since then, the CI broke again, with errors like: $ python -m build RuntimeError: Virtual environment creation failed, executable /tmp/build-…/local/bin/python missing I found that using our previous `pip install` commands worked. GitHub or Ubuntu maintainers probably fixed the inconveniences described by Hoël at #234.
GitHub is rolling out
ubuntu-24.04
as the newubuntu-latest
on GitHubActions1. Previously it was
ubuntu-22.04
.There are many small breaking changes that people are complaining about in
this update2.
Localstripe is impacted by the fact that
pip
now fails on installing a paquetsystem-wide with the following error:
There are multiple solutions to this as proposed in the error message:
sudo apt install python3-...
python -m venv venv
pipx
pip
option--break-system-packages
ubuntu-22.04
instead ofubuntu-latest
For the package
build
,python3-build
exists, so let's use it. Forlocalstripe-*.tar.gz
, as we already are in an isolated container wherebreaking Python is meaningless, and as there is nothing in that container that
might actually break when we install Localstripe, let's just use the option
--break-system-packages
.After this commit, the CI works again with
ubuntu-latest
.Footnotes
https://github.blog/changelog/2024-09-25-actions-new-images-and-ubuntu-latest-changes/ ↩
https://github.com/actions/runner-images/issues/10636 ↩