Skip to content

Commit

Permalink
Merge pull request #200 from iiasa/ci/numpy-2
Browse files Browse the repository at this point in the history
Adjust CI for numpy 2.0, graphviz, pint
  • Loading branch information
khaeru committed Jun 17, 2024
2 parents c6285cf + 6733914 commit dad8f8a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
21 changes: 15 additions & 6 deletions message_ix_models/tests/test_workflow.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import platform
import re
from typing import Optional

Expand All @@ -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
Expand Down Expand Up @@ -87,7 +95,8 @@ def _wf(
return wf


@MARK
@MARK[0]
@MARK[1]
def test_make_click_command(mix_models_cli) -> None:
import click

Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit dad8f8a

Please sign in to comment.