From 30880791f8e72e0d6b50a1292d8be1de7461f0ea Mon Sep 17 00:00:00 2001 From: Paul Natsuo Kishimoto Date: Mon, 17 Jun 2024 13:22:16 +0200 Subject: [PATCH 1/3] Work around hgrecco/pint#2007, unionai-oss/pandera#1685 --- .github/workflows/pytest.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index ec09e55352..1eaeb5a908 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -109,6 +109,10 @@ jobs: pip install .[docs,tests] ${{ matrix.upstream.extra-deps }} + # TEMPORARY Work around hgrecco/pint#2007, unionai-oss/pandera#1685; + # see https://github.com/khaeru/genno/issues/140 + pip install "pint != 0.24.0" "numpy < 2" + - name: Configure local data path run: | mkdir -p message-local-data/cache From 2820ab08e37c5c686d150ea30882158cf7e9acae Mon Sep 17 00:00:00 2001 From: Paul Natsuo Kishimoto Date: Mon, 17 Jun 2024 13:38:13 +0200 Subject: [PATCH 2/3] Work around ts-graphviz/setup-graphviz#630 --- .github/workflows/pytest.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index 1eaeb5a908..a825d0f684 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -91,8 +91,8 @@ jobs: license: ${{ secrets.GAMS_LICENSE }} - uses: ts-graphviz/setup-graphviz@v2 - with: - macos-skip-brew-update: true + # TEMPORARY Work around ts-graphviz/setup-graphviz#630 + if: ${{ ! startswith(matrix.os, 'macos-') }} - name: Install packages and dependencies # By default, install: From 67339148893ada222d2c112ae8c772106cbe539b Mon Sep 17 00:00:00 2001 From: Paul Natsuo Kishimoto Date: Mon, 17 Jun 2024 13:58:06 +0200 Subject: [PATCH 3/3] Xfail tests using graphviz on GHA/macOS --- message_ix_models/tests/test_workflow.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/message_ix_models/tests/test_workflow.py b/message_ix_models/tests/test_workflow.py index 9874374638..65164bf12d 100644 --- a/message_ix_models/tests/test_workflow.py +++ b/message_ix_models/tests/test_workflow.py @@ -1,3 +1,4 @@ +import platform import re from typing import Optional @@ -6,12 +7,19 @@ from message_ix import make_df from message_ix_models import Workflow, testing +from message_ix_models.testing import GHA from message_ix_models.workflow import WorkflowStep, make_click_command, solve -MARK = pytest.mark.skipif( - condition=ixmp.__version__ < "3.5", - reason="ixmp.TimeSeries.url not available prior to ixmp 3.5.0", -) +MARK = { + 0: pytest.mark.skipif( + condition=ixmp.__version__ < "3.5", + reason="ixmp.TimeSeries.url not available prior to ixmp 3.5.0", + ), + 1: pytest.mark.xfail( + condition=GHA and platform.system() == "Darwin", + reason="Graphviz not available for GitHub Actions jobs on macOS", + ), +} # Functions for WorkflowSteps @@ -87,7 +95,8 @@ def _wf( return wf -@MARK +@MARK[0] +@MARK[1] def test_make_click_command(mix_models_cli) -> None: import click @@ -123,7 +132,7 @@ def test_make_click_command(mix_models_cli) -> None: assert output in result.output -@MARK +@MARK[0] def test_workflow(caplog, request, test_context, wf) -> None: # Retrieve some information from the fixture mp = wf.graph.pop("_base_platform")