From 402f29669ace776dbeca0a36bd17ea7a5a5fa3ce Mon Sep 17 00:00:00 2001 From: bn Date: Mon, 22 Jul 2024 09:15:27 +0200 Subject: [PATCH 1/2] Change default numpy2 printing options in `test.py`. Change the default numpy 2 printing options that crash doctests on scalars. --- polze/test.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/polze/test.py b/polze/test.py index af31bab..aeafd21 100644 --- a/polze/test.py +++ b/polze/test.py @@ -24,6 +24,11 @@ import cmath import sys +# Numpy 2.0 change default printing options making doctest failing. +# https://numpy.org/neps/nep-0051-scalar-representation.html +# Use legacy mode for testing +if np.lib.NumpyVersion(np.__version__) >= '2.0.0b1': + np.set_printoptions(legacy="1.25") # Define a non vectorized function # For parallel processing we need a function defined outside the class. From fbe1824a216443e700d4bf4f4fe40b6dae82f9c6 Mon Sep 17 00:00:00 2001 From: bn Date: Mon, 22 Jul 2024 09:29:54 +0200 Subject: [PATCH 2/2] Change python versions in CI . - Remove 3.6 and 3.7 now in end of life. - update windows test to 3.11 --- .github/workflows/ci-ubuntu.yml | 2 +- .github/workflows/ci-windows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-ubuntu.yml b/.github/workflows/ci-ubuntu.yml index 7d091a5..6377771 100644 --- a/.github/workflows/ci-ubuntu.yml +++ b/.github/workflows/ci-ubuntu.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index f944c98..ae277a6 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -15,7 +15,7 @@ jobs: - uses: conda-incubator/setup-miniconda@v2 with: activate-environment: polze_env - python-version: 3.9 + python-version: "3.11" auto-activate-base: false miniconda-version: "latest" auto-update-conda: true