-
Notifications
You must be signed in to change notification settings - Fork 552
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
Set up a virtual environment or install pipenv
to cope with the new Ubuntu runner
#952
Comments
Hi @Kodiologist, |
Apparently, this already works, at least sometimes, but I remember having trouble with it earlier. I'm not sure what's going on. |
Hmm it works for our workloads using ubuntu 24.04. we run - name: Set up Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
with:
python-version: '3.12'
cache: 'pip'
cache-dependency-path: '**/requirements.txt'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r path/to/requirements/requirements.txt Tested it hard against ubuntu-24.04 runner just to be sure |
This morning we've had a load of dependabot PRs run into this issue. Each of our repos actions are running against We're using https://github.com/abatilo/actions-poetry but it's failing at the most basic step:
For now I'm setting our various actions runners to If the intention is to keep the PEP 668 behaviour with Thanks for any help. |
ubuntu-latest (24.04) has newer version of pip which blocks installing packages outside of a venv, which our actions and some upstream actions we use rely on. Quickest to roll back the runner version for the short-term until the upstream actions are patched. actions/setup-python#952
ubuntu-latest (24.04) has newer version of pip which blocks installing packages outside of a venv, which our actions and some upstream actions we use rely on. Quickest to roll back the runner version for the short-term until the upstream actions are patched. actions/setup-python#952
We're seeing the requirement for a virtual environment in dependabot pull requests, too. Before we make massive changes to our GitHub Actions, we seek guidance from the authors of Thank you for your good work! |
As a response to the requirements of the new [repository-name]/.github/workflows/check-dependencies.yaml name: Check dependencies
on: [pull_request]
permissions:
contents: read
jobs:
check-dependencies:
name: Check dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
- name: Install dependencies
run: |
python -m venv ./venv
source ./venv/bin/activate
echo "PATH=${PATH}" >> "${GITHUB_ENV}"
python -m pip install --upgrade pip
python -m pip install --requirement requirements.txt |
Note that Personally, I use this on all my systems. export PIP_BREAK_SYSTEM_PACKAGES=1
echo "export PIP_BREAK_SYSTEM_PACKAGES=1" >> "$HOME/.bashrc" I have added this step to my workflow YAML: jobs:
Tests:
steps:
- name: Fix pip
run: |
echo "PIP_BREAK_SYSTEM_PACKAGES=1" >> "${GITHUB_ENV}" Alternatively, it can be done via echo '[global]\nbreak-system-packages = true' >> "$HOME/.config/pip/pip.conf" MacOS: echo '[global]\nbreak-system-packages = true' >> "$HOME/Library/Application Support/pip/pip.conf" |
Justification:
GitHub is in the process of updating
ubuntu-latest
to Ubuntu 24.04 (actions/runner-images#10636), which leads topip install
crashing witherror: externally-managed-environment
.Description:
Prevent people's jobs from breaking by making
pip install
work (presumably by either setting up a virtual environment or by implicitly enabling--break-system-packages
). Or perhaps runsudo apt install pipenv
and tell people to usepipenv
instead ofpip
, but then everyone will still have to change their jobs.Are you willing to submit a PR?
Nah.
The text was updated successfully, but these errors were encountered: