From 5618fa629205382ad1417019bf0f98b63a6b7896 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Tue, 5 Oct 2021 18:07:32 +0200 Subject: [PATCH] CI Py3.10. --- .github/workflows/build.yml | 5 ++--- run-mpl-test-suite.py | 5 +++-- src/_util.h | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da42f2ab..0ec205f9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,7 @@ jobs: strategy: matrix: os: [ubuntu-18.04, macos-10.15, windows-2019] - python-version: ["3.7", "3.8", "3.9"] + python-version: ["3.7", "3.8", "3.9", "3.10"] fail-fast: false runs-on: ${{ matrix.os }} steps: @@ -53,9 +53,8 @@ jobs: python -mpip install dist/*.whl && python tools/ensure-mpl-test-data.py && - # pytest 6.2 is incompatible with matplotlib<3.4 # pytest-{instafail,timeout} useful for hanging tests. - python -mpip install 'pytest<6.2' pytest-instafail pytest-timeout + python -mpip install pytest pytest-instafail pytest-timeout - name: Test shell: bash run: | diff --git a/run-mpl-test-suite.py b/run-mpl-test-suite.py index 25b6b6e0..a156e7b9 100755 --- a/run-mpl-test-suite.py +++ b/run-mpl-test-suite.py @@ -7,7 +7,6 @@ """ from argparse import ArgumentParser -from distutils.version import LooseVersion import os from pathlib import Path import sys @@ -21,6 +20,8 @@ import matplotlib.backends.backend_agg import matplotlib.testing.decorators +from packaging.version import parse as parse_version + import pytest @@ -194,7 +195,7 @@ def pytest_collection_modifyitems(session, config, items): ] for nodeid in nodeids } - if LooseVersion(mpl.__version__) < "3.0": + if parse_version(mpl.__version__) < parse_version("3.0"): module_markers.update({ "matplotlib.sphinxext.test_tinypages": irrelevant, # matplotlib#11360. }) diff --git a/src/_util.h b/src/_util.h index 5e8d525b..52906615 100644 --- a/src/_util.h +++ b/src/_util.h @@ -14,6 +14,7 @@ template overloaded(Ts...) -> overloaded; namespace mplcairo { namespace py = pybind11; +using ssize_t = Py_ssize_t; namespace detail {