From 6fb781bfaf7a21b5438d4441f058c1f349d7feb3 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Thu, 7 Nov 2024 20:14:15 +0000 Subject: [PATCH] Error on warnings when testing (#620) * Error on warnings when testing * Ignore Python 3.13 warning * Use extra to install zfpy * Filter ragged warning * style: pre-commit fixes --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- numcodecs/tests/test_compat.py | 3 +++ numcodecs/tests/test_msgpacks.py | 3 +++ pyproject.toml | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5d03f8a3..57e6f0b0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -77,7 +77,7 @@ jobs: shell: "bash -l {0}" run: | conda activate env - python -m pip install "zfpy>=1" "numpy<2" + python -m pip install -v ".[zfpy]" - name: List installed packages shell: "bash -l {0}" diff --git a/numcodecs/tests/test_compat.py b/numcodecs/tests/test_compat.py index 64addf6a..0d5f2d74 100644 --- a/numcodecs/tests/test_compat.py +++ b/numcodecs/tests/test_compat.py @@ -64,6 +64,9 @@ def test_ensure_bytes_invalid_inputs(): ensure_bytes(e) +@pytest.mark.filterwarnings( + "ignore:The 'u' type code is deprecated and will be removed in Python 3.16" +) def test_ensure_contiguous_ndarray_invalid_inputs(): # object array not allowed a = np.array(['Xin chào thế giới'], dtype=object) diff --git a/numcodecs/tests/test_msgpacks.py b/numcodecs/tests/test_msgpacks.py index c05cc78d..4f877845 100644 --- a/numcodecs/tests/test_msgpacks.py +++ b/numcodecs/tests/test_msgpacks.py @@ -55,6 +55,9 @@ def test_backwards_compatibility(): check_backwards_compatibility(codec.codec_id, arrays, [codec]) +@pytest.mark.filterwarnings( + "ignore:Creating an ndarray from ragged nested sequences .* is deprecated.*" +) @pytest.mark.parametrize( ("input_data", "dtype"), [ diff --git a/pyproject.toml b/pyproject.toml index c336c72c..d1026104 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -128,6 +128,10 @@ norecursedirs = [ ] log_cli_level = "INFO" xfail_strict = true +filterwarnings = [ + "error", +] + [tool.cibuildwheel] environment = { DISABLE_NUMCODECS_AVX2=1 } [tool.cibuildwheel.macos]