From 105777ac067d6b728a0514ae31929085fb8dc262 Mon Sep 17 00:00:00 2001 From: Cail Daley Date: Tue, 30 Jun 2026 08:48:37 +0200 Subject: [PATCH] ci: drop archived pytest-pydocstyle; xfail test_xipm_theo on numpy>=2.5 Two pre-existing CI breakages, both dependency drift, neither a source bug: 1. pytest-pydocstyle is archived upstream and its pytest_collect_file hook still declares the legacy `path` arg that pytest 9.1 removed from the hookspec, so pytest aborted at startup with PluginValidationError. Since the plugin will never be updated, remove it rather than pin pytest back. Docstring linting, if wanted, should move to a maintained tool (ruff's pydocstyle `D` rules). 2. With pytest running again, test_cosmo::test_xipm_theo fails on Python 3.12 (numpy 2.5.0): pyccl 3.3.4 calls float() on a non-0-d array in boltzmann.py, which numpy>=2.5 turns into a hard TypeError. xfail it (conditioned on numpy>=2.5, non-strict) as a stopgap. The real fix and the broader "where should cosmology code live" question are tracked in CosmoStat/cs_util#71. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01BXY93SBtDvLLrxWX8Vh4KW --- cs_util/tests/test_cosmo.py | 13 +++++++++++++ pyproject.toml | 5 ++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/cs_util/tests/test_cosmo.py b/cs_util/tests/test_cosmo.py index e95eb84..bf058c6 100644 --- a/cs_util/tests/test_cosmo.py +++ b/cs_util/tests/test_cosmo.py @@ -9,6 +9,7 @@ from numpy import testing as npt import numpy as np +import pytest from astropy import units import pyccl as ccl @@ -278,7 +279,19 @@ def test_get_cosmo_default(self): npt.assert_equal(pickle.dumps(cos_def), pickle.dumps(self._cos_def)) + @pytest.mark.xfail( + np.lib.NumpyVersion(np.__version__) >= "2.5.0", + reason=( + "pyccl 3.3.4 calls float() on a non-0-d array in boltzmann.py, " + "which numpy>=2.5 turns into a hard TypeError; not a cs_util bug. " + "Stopgap, not the real fix. Tracked in CosmoStat/cs_util#71 " + "(revisit the pyccl/numpy pin and where cosmology code should " + "live)." + ), + strict=False, + ) def test_xipm_theo(self): + """Test ``cs_util.xipm_theo``: xi+/- theory against stored values.""" xip, xim = cosmo.xipm_theo( self._theta, self._cosmo, diff --git a/pyproject.toml b/pyproject.toml index 38eeaa6..48b1764 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,8 +36,11 @@ release = [ "twine", ] test = [ + # pytest-pydocstyle removed: its upstream is archived and incompatible + # with the pytest 9.1 collect-file hookspec (it crashed CI at startup). + # Docstring linting, if wanted, should move to a maintained tool (ruff's + # pydocstyle `D` rules). "pytest", - "pytest-pydocstyle", "pytest-cov", ] docs = [