Skip to content

Commit 8dc9610

Browse files
committed
CI: Install python3-build & add --break-system-packages for Localstripe
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
1 parent 8bd29d4 commit 8dc9610

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/tests.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ jobs:
4141
uses: actions/setup-python@v4
4242
with:
4343
python-version: ${{ matrix.pyver }}
44-
- run: pip install 'pip >=23' build
44+
- run: sudo apt install python3-build
4545
- run: python -m build
46-
- run: pip install dist/localstripe-*.tar.gz
46+
- run: pip install dist/localstripe-*.tar.gz --break-system-packages
4747
- run: python -m localstripe &
4848
# Wait for server to be up:
4949
- run: >

0 commit comments

Comments
 (0)