From fc63221fd921c816617eee5c4755bc8602a8fb46 Mon Sep 17 00:00:00 2001 From: Toon Verstraelen Date: Sat, 8 Jun 2024 10:33:10 +0200 Subject: [PATCH 1/5] Stricter testing - When testing with the old Python version (3.9 at the moment), the oldest supported versions of the dependencies are installed. - The option `-W error` is added to pytest, so that it fails in case of a warning. --- .github/workflows/pytest.yaml | 5 +++++ doc/install.rst | 4 ++++ pyproject.toml | 4 +++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index c33ba83b..eca94603 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -22,6 +22,11 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + - name: Install oldest versions of supported dependencies + if: ${{ matrix.python-version == "3.9"}} + # Changes to these dependencies must be updated + # in pyproject.toml and docs/install.rst + run: pip install numpy==1.22 scipy==1.8 attrs==21.3.0 - name: Install development version run: pip install -e .[dev] - name: Run Pytest diff --git a/doc/install.rst b/doc/install.rst index 7b363751..b287994b 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -30,6 +30,10 @@ Latest PyPI version Python 3 (>=3.9) must be installed before you can install IOData. In addition, IOData has the following dependencies: +.. + Changes to these dependencies must be updated + in pyproject.toml and .github/workfloews/pytest.yaml + - numpy >= 1.22: https://numpy.org/ - scipy >= 1.8: https://scipy.org/ - attrs >= 21.3.0: https://www.attrs.org/en/stable/index.html diff --git a/pyproject.toml b/pyproject.toml index eeed55f7..3b050890 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,6 +29,8 @@ classifiers = [ "Topic :: Scientific/Engineering :: Chemistry", ] dependencies = [ + # Changes to these dependencies must be updated + # in .github/workfloews/pytest.yaml and docs/install.rst "numpy>=1.22", "scipy>=1.8", "attrs>=21.3.0", @@ -47,7 +49,7 @@ Source = "https://github.com/theochem/iodata/" iodata-convert = "iodata.__main__:main" [tool.pytest.ini_options] -addopts = "-n auto" +addopts = "-n auto -W error" [tool.setuptools] packages = ["iodata"] From 3fb79decb8be34337abd17b9ee1224bc1457ddf2 Mon Sep 17 00:00:00 2001 From: Toon Verstraelen Date: Sat, 8 Jun 2024 10:37:58 +0200 Subject: [PATCH 2/5] Update .github/workflows/pytest.yaml Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --- .github/workflows/pytest.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index eca94603..e27274e8 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -24,7 +24,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install oldest versions of supported dependencies if: ${{ matrix.python-version == "3.9"}} - # Changes to these dependencies must be updated + # Ensure changes to these dependencies are reflected # in pyproject.toml and docs/install.rst run: pip install numpy==1.22 scipy==1.8 attrs==21.3.0 - name: Install development version From e16fc388efce601f6debadf0b4361230d687375b Mon Sep 17 00:00:00 2001 From: Toon Verstraelen Date: Sat, 8 Jun 2024 10:40:58 +0200 Subject: [PATCH 3/5] Small fixes --- .github/workflows/pytest.yaml | 2 +- doc/install.rst | 2 +- pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index e27274e8..0df6fca5 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -23,7 +23,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install oldest versions of supported dependencies - if: ${{ matrix.python-version == "3.9"}} + if: ${{ matrix.python-version == '3.9'}} # Ensure changes to these dependencies are reflected # in pyproject.toml and docs/install.rst run: pip install numpy==1.22 scipy==1.8 attrs==21.3.0 diff --git a/doc/install.rst b/doc/install.rst index b287994b..ac8a7bcf 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -31,7 +31,7 @@ Python 3 (>=3.9) must be installed before you can install IOData. In addition, IOData has the following dependencies: .. - Changes to these dependencies must be updated + Ensure changes to these dependencies are reflected in pyproject.toml and .github/workfloews/pytest.yaml - numpy >= 1.22: https://numpy.org/ diff --git a/pyproject.toml b/pyproject.toml index 3b050890..615a129a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ classifiers = [ "Topic :: Scientific/Engineering :: Chemistry", ] dependencies = [ - # Changes to these dependencies must be updated + # Ensure changes to these dependencies are reflected # in .github/workfloews/pytest.yaml and docs/install.rst "numpy>=1.22", "scipy>=1.8", From 4d113c3266757690c59179a4bc75fd340bf87e00 Mon Sep 17 00:00:00 2001 From: Toon Verstraelen Date: Sat, 8 Jun 2024 10:53:05 +0200 Subject: [PATCH 4/5] Set oldest supported SciPy to 1.10 --- .github/workflows/pytest.yaml | 2 +- doc/install.rst | 2 +- iodata/overlap.py | 3 ++- pyproject.toml | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index 0df6fca5..59a43919 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -26,7 +26,7 @@ jobs: if: ${{ matrix.python-version == '3.9'}} # Ensure changes to these dependencies are reflected # in pyproject.toml and docs/install.rst - run: pip install numpy==1.22 scipy==1.8 attrs==21.3.0 + run: pip install numpy==1.22 scipy==1.10 attrs==21.3.0 - name: Install development version run: pip install -e .[dev] - name: Run Pytest diff --git a/doc/install.rst b/doc/install.rst index ac8a7bcf..dcd122f9 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -35,7 +35,7 @@ In addition, IOData has the following dependencies: in pyproject.toml and .github/workfloews/pytest.yaml - numpy >= 1.22: https://numpy.org/ -- scipy >= 1.8: https://scipy.org/ +- scipy >= 1.10: https://scipy.org/ - attrs >= 21.3.0: https://www.attrs.org/en/stable/index.html Normally, you don't need to install these dependencies manually. They will be diff --git a/iodata/overlap.py b/iodata/overlap.py index cca52633..ea3b4d46 100644 --- a/iodata/overlap.py +++ b/iodata/overlap.py @@ -35,7 +35,8 @@ def factorial2(n: Union[int, NDArray[int]]) -> Union[int, NDArray[int]]: """Modifcied scipy.special.factorial2 that returns 1 when the input is -1. - This is a temporary workaround while we wait for Scipy's update. + The future implementation of factorial2 in SciPy will not return + the correct result for n=-1 (for our purposes). To learn more, see https://github.com/scipy/scipy/issues/18409. This function only supports integer (array) arguments, diff --git a/pyproject.toml b/pyproject.toml index 615a129a..e8406824 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ dependencies = [ # Ensure changes to these dependencies are reflected # in .github/workfloews/pytest.yaml and docs/install.rst "numpy>=1.22", - "scipy>=1.8", + "scipy>=1.10", "attrs>=21.3.0", ] dynamic = ["version"] From 3c2f49f46ce64edb8e4ceb350f36d929bbff16c0 Mon Sep 17 00:00:00 2001 From: Toon Verstraelen Date: Sat, 8 Jun 2024 10:55:50 +0200 Subject: [PATCH 5/5] Set oldest supported SciPy to 1.11 --- .github/workflows/pytest.yaml | 2 +- doc/install.rst | 2 +- pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index 59a43919..22d3b30d 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -26,7 +26,7 @@ jobs: if: ${{ matrix.python-version == '3.9'}} # Ensure changes to these dependencies are reflected # in pyproject.toml and docs/install.rst - run: pip install numpy==1.22 scipy==1.10 attrs==21.3.0 + run: pip install numpy==1.22 scipy==1.11 attrs==21.3.0 - name: Install development version run: pip install -e .[dev] - name: Run Pytest diff --git a/doc/install.rst b/doc/install.rst index dcd122f9..c750e1cb 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -35,7 +35,7 @@ In addition, IOData has the following dependencies: in pyproject.toml and .github/workfloews/pytest.yaml - numpy >= 1.22: https://numpy.org/ -- scipy >= 1.10: https://scipy.org/ +- scipy >= 1.11: https://scipy.org/ - attrs >= 21.3.0: https://www.attrs.org/en/stable/index.html Normally, you don't need to install these dependencies manually. They will be diff --git a/pyproject.toml b/pyproject.toml index e8406824..20e87673 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ dependencies = [ # Ensure changes to these dependencies are reflected # in .github/workfloews/pytest.yaml and docs/install.rst "numpy>=1.22", - "scipy>=1.10", + "scipy>=1.11", "attrs>=21.3.0", ] dynamic = ["version"]