From 5b8dbd56ef6b7b70bf69c9499514bbac3466562a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20=C5=81opaciuk?= Date: Wed, 2 Nov 2022 11:18:33 +0100 Subject: [PATCH] fix issue with pip install -e on ubuntu-22.04 runners MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (https://github.com/actions/runner-images/issues/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 https://github.com/pypa/pip/issues/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 --- .github/workflows/test_gh.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_gh.yaml b/.github/workflows/test_gh.yaml index 5ae30ef7..046e75be 100644 --- a/.github/workflows/test_gh.yaml +++ b/.github/workflows/test_gh.yaml @@ -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 }} @@ -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