diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index e628f9bde..5ca9ba3de 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -171,7 +171,7 @@ jobs: - uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.13" cache: pip cache-dependency-path: "**/pyproject.toml" @@ -251,7 +251,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: # Same as the "Latest version supported by message_ix", above - python-version: "3.12" + python-version: "3.13" - name: Force recreation of pre-commit virtual environment for mypy if: github.event_name == 'schedule' # Comment this line to run on a PR diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 32c915cc7..62294a283 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - types-requests args: ["."] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.9 + rev: v0.8.4 hooks: - id: ruff - id: ruff-format diff --git a/message_ix/tests/test_report.py b/message_ix/tests/test_report.py index 9523a23fe..53f8f7d94 100644 --- a/message_ix/tests/test_report.py +++ b/message_ix/tests/test_report.py @@ -1,5 +1,6 @@ import logging import re +import sys from functools import partial from pathlib import Path @@ -203,18 +204,34 @@ def add_tm(df, name="Activity"): assert not any(c in df2.columns for c in ["h", "m", "t"]) # Variable names were formatted by the callback - reg_var = pd.DataFrame( - [ - ["san-diego", "Activity|canning_plant|production"], - ["san-diego", "Activity|transport_from_san-diego|to_chicago"], - ["san-diego", "Activity|transport_from_san-diego|to_new-york"], - ["san-diego", "Activity|transport_from_san-diego|to_topeka"], - ["seattle", "Activity|canning_plant|production"], - ["seattle", "Activity|transport_from_seattle|to_chicago"], - ["seattle", "Activity|transport_from_seattle|to_new-york"], - ["seattle", "Activity|transport_from_seattle|to_topeka"], - ], - columns=["region", "variable"], + reg_var = ( + pd.DataFrame( + [ + ["seattle", "Activity|canning_plant|production"], + ["seattle", "Activity|transport_from_seattle|to_new-york"], + ["seattle", "Activity|transport_from_seattle|to_chicago"], + ["seattle", "Activity|transport_from_seattle|to_topeka"], + ["san-diego", "Activity|canning_plant|production"], + ["san-diego", "Activity|transport_from_san-diego|to_new-york"], + ["san-diego", "Activity|transport_from_san-diego|to_chicago"], + ["san-diego", "Activity|transport_from_san-diego|to_topeka"], + ], + columns=["region", "variable"], + ) + if sys.version_info >= (3, 10) + else pd.DataFrame( + [ + ["san-diego", "Activity|canning_plant|production"], + ["san-diego", "Activity|transport_from_san-diego|to_chicago"], + ["san-diego", "Activity|transport_from_san-diego|to_new-york"], + ["san-diego", "Activity|transport_from_san-diego|to_topeka"], + ["seattle", "Activity|canning_plant|production"], + ["seattle", "Activity|transport_from_seattle|to_chicago"], + ["seattle", "Activity|transport_from_seattle|to_new-york"], + ["seattle", "Activity|transport_from_seattle|to_topeka"], + ], + columns=["region", "variable"], + ) ) assert_frame_equal(df2[["region", "variable"]], reg_var)