From 6415d04cf7125e8d1f5db84e0058c94afe63d0bd Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Tue, 1 Oct 2024 08:29:35 +0000 Subject: [PATCH] Fix CI --- .github/workflows/ci-build.yml | 13 +++++++++++++ noxfile.py | 8 ++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index a9888050..a6c24f8f 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -141,6 +141,11 @@ jobs: - name: Create search_api_mapping.json run: cp datagateway_api/search_api_mapping.json.example datagateway_api/search_api_mapping.json + + # See comment in noxfile.py for explanation regarding this step + - name: Downgrade setuptools + run: pip install --upgrade setuptools==70.0.0 + if: matrix.python-version == '3.8' || matrix.python-version == '3.9' || matrix.python-version == '3.10' - name: Install dependencies run: poetry install @@ -287,6 +292,10 @@ jobs: - name: Install Requests run: pip install 'requests<2.30' + + # See comment in noxfile.py for explanation regarding this step + - name: Downgrade setuptools + run: pip install --upgrade setuptools==70.0.0 - name: Install dependencies run: poetry install @@ -342,6 +351,10 @@ jobs: - name: Create search_api_mapping.json run: cd /home/runner/work/datagateway-api/datagateway-api; cp datagateway_api/search_api_mapping.json.example datagateway_api/search_api_mapping.json + + # See comment in noxfile.py for explanation regarding this step + - name: Downgrade setuptools + run: pip install --upgrade setuptools==70.0.0 - name: Install dependencies run: poetry install diff --git a/noxfile.py b/noxfile.py index 391ffffd..d50a75a8 100644 --- a/noxfile.py +++ b/noxfile.py @@ -203,7 +203,9 @@ def unit_tests(session): # A cleaner fix would be to upgrade the packaging library to 22.0+ (as per # https://github.com/pypa/setuptools/issues/4483#issuecomment-2236339726) but this # cannot be done on this repo until support for Python 3.6 is dropped - session.run("pip", "install", "--upgrade", "setuptools==70.0.0") + if session.python in ["3.8", "3.9", "3.10"]: + session.run("pip", "install", "--upgrade", "setuptools==70.0.0") + session.run("poetry", "install", external=True) session.run("pytest", "test/unit", *args) @@ -213,6 +215,8 @@ def integration_tests(session): args = session.posargs # Explicit downgrade of setuptools also performed here. See explanation in # `unit_tests()` - session.run("pip", "install", "--upgrade", "setuptools==70.0.0") + if session.python in ["3.8", "3.9", "3.10"]: + session.run("pip", "install", "--upgrade", "setuptools==70.0.0") + session.run("poetry", "install", external=True) session.run("pytest", "test/integration", *args)