Skip to content

Commit

Permalink
fix issue with pip install -e on ubuntu-22.04 runners
Browse files Browse the repository at this point in the history
This fixes an issue that arises due to the crossover of three
different problems:

1. Ubuntu 22.04 will be used by default on 'ubuntu' runners on GitHub runners
   (actions/runner-images#6399).

2. Ubuntu 22.04 ships with `setuptools` version 59.x.x, which has a bug that
   does not allow an `--editable` installation of packages in `--user` mode.
   The flag `--user` is presumed regardless, as the location with packages is
   not writable by normal users (see pypa/pip#7953
   and https://bugs.launchpad.net/ubuntu/+source/setuptools/+bug/1994016).

3. We need an `--editable` installation in order to run tests, as the
   `test_data` folder is loaded with respect to the package root, and
   not the test root (see for example:
   https://github.com/xsuite/xpart/blob/45d621ad060bc25d361835bde1ed985609a24c49/tests/test_single_rf_harmonic_matcher.py#L25)

Signed-off-by: Szymon Łopaciuk <szymon@lopaciuk.eu>
  • Loading branch information
szymonlopaciuk committed Nov 2, 2022
1 parent 198c382 commit 5b8dbd5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test_gh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get install -y pocl-opencl-icd
pip install pytest pyopencl cython
sudo pip install --upgrade pytest pyopencl cython setuptools
- name: Check out xsuite repos & pip install
env:
xobjects_branch: ${{ inputs.xobjects_location }}
Expand All @@ -67,7 +67,7 @@ jobs:
cd $GITHUB_WORKSPACE
git clone -b "$branch" --single-branch "https://github.com/${user}/${project}.git"
pip install -e "${GITHUB_WORKSPACE}/${project}[tests]"
pip install --user -e "${GITHUB_WORKSPACE}/${project}[tests]"
done
- name: Print versions
run: pip freeze
Expand Down

0 comments on commit 5b8dbd5

Please sign in to comment.