Repository: numba/numba-scipy (language: python)

Issue:
Upgrading Scipy dependency to >1.7.3
Hi, 

Since the most recent numba supports numpy 1.23 is there any chance the scipy dependency can be bumped to a newer version so that numba-scipy can be installed alongside numpy 1.23? Scipy 1.7.3 has a numpy version limit of <1.23.

I've had a bit of a look to see if there seems to be a reason not to. A plain `pytest` works fine with a few warnings and with `pytest -Werror` the following three tests fail with the warning `numba_scipy/tests/test_special.py:55: DeprecationWarning: non-integer arg n is deprecated, removed in SciPy 1.7.x`:
```bash
FAILED numba_scipy/tests/test_special.py::test_function[bdtr-specialization125] 
FAILED numba_scipy/tests/test_special.py::test_function[bdtrc-specialization127] 
FAILED numba_scipy/tests/test_special.py::test_function[bdtri-specialization129] 
```
Seemingly as the typing is pulled directly from scipy it is not something numba-scipy can control but even on the most recent scipy (1.9.1) all functions seem to still work with float arguments (although they pump out the same warning). If the functions are used with an int where appropriate both wrapped with numba and without the output seem the same and have no warnings.

Is there anything I am missing to stop bumping the scipy version?

I'm happy to open a PR to bump the version if there isn't. Thanks very much for your work on numba-scipy

Upgrading Scipy dependency to >1.7.3
Hi, 

Since the most recent numba supports numpy 1.23 is there any chance the scipy dependency can be bumped to a newer version so that numba-scipy can be installed alongside numpy 1.23? Scipy 1.7.3 has a numpy version limit of <1.23.

I've had a bit of a look to see if there seems to be a reason not to. A plain `pytest` works fine with a few warnings and with `pytest -Werror` the following three tests fail with the warning `numba_scipy/tests/test_special.py:55: DeprecationWarning: non-integer arg n is deprecated, removed in SciPy 1.7.x`:
```bash
FAILED numba_scipy/tests/test_special.py::test_function[bdtr-specialization125] 
FAILED numba_scipy/tests/test_special.py::test_function[bdtrc-specialization127] 
FAILED numba_scipy/tests/test_special.py::test_function[bdtri-specialization129] 
```
Seemingly as the typing is pulled directly from scipy it is not something numba-scipy can control but even on the most recent scipy (1.9.1) all functions seem to still work with float arguments (although they pump out the same warning). If the functions are used with an int where appropriate both wrapped with numba and without the output seem the same and have no warnings.

Is there anything I am missing to stop bumping the scipy version?

I'm happy to open a PR to bump the version if there isn't. Thanks very much for your work on numba-scipy

Initial setup
This PR:
 * Adds versioning
 * Adds flake8
 * Adds conda package build
 * Adds `requirements.txt`


Discussion / hints:
@je-cook thank you for suggesting this. AFAICT there is no SciPy 1.9 available from anaconda yet:

https://anaconda.org/anaconda/scipy/files

I would like to suggest to wait with the upgrade until it becomes available.
Thanks for the reply @esc. That makes sense. I assume that you want to stay on the default anaconda branch too? 

Otherwise conda-forge already has scipy 1.9.1: https://anaconda.org/conda-forge/scipy
> Thanks for the reply @esc. That makes sense. I assume that you want to stay on the default anaconda branch too?
> 
> Otherwise conda-forge already has scipy 1.9.1: https://anaconda.org/conda-forge/scipy

Ideally, yes, we want to stay on the Anaconda provided packages.
@je-cook thank you for suggesting this. AFAICT there is no SciPy 1.9 available from anaconda yet:

https://anaconda.org/anaconda/scipy/files

I would like to suggest to wait with the upgrade until it becomes available.
Thanks for the reply @esc. That makes sense. I assume that you want to stay on the default anaconda branch too? 

Otherwise conda-forge already has scipy 1.9.1: https://anaconda.org/conda-forge/scipy
> Thanks for the reply @esc. That makes sense. I assume that you want to stay on the default anaconda branch too?
> 
> Otherwise conda-forge already has scipy 1.9.1: https://anaconda.org/conda-forge/scipy

Ideally, yes, we want to stay on the Anaconda provided packages.
Looks good.

Fix patch:
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 1dcd689..f862699 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -3,29 +3,23 @@ jobs:
 - template: buildscripts/azure/azure-linux-macos.yml
   parameters:
     name: Linux
-    vmImage: ubuntu-18.04
+    vmImage: ubuntu-22.04
     matrix:
-      py37_np116_sp11:
-        PYTHON: '3.7'
-        NUMPY: '1.16'
-        SCIPY: '1.1'
+      py310_np123_sp1_10:
+        PYTHON: '3.10'
+        NUMPY: '1.23'
+        SCIPY: '1.10'
         CONDA_ENV: 'testenv'
-      py37_np115_sp11_32bit:
-        PYTHON: '3.7'
-        NUMPY: '1.15'
-        SCIPY: '1.1'
-        CONDA_ENV: 'testenv'
-        BITS32: yes
 
 - template: buildscripts/azure/azure-linux-macos.yml
   parameters:
     name: macOS
-    vmImage: macOS-10.15
+    vmImage: macOS-latest
     matrix:
-      py37_np116_sp11:
-        PYTHON: '3.7'
-        NUMPY: '1.16'
-        SCIPY: '1.1'
+      py310_np123_sp1_10:
+        PYTHON: '3.10'
+        NUMPY: '1.23'
+        SCIPY: '1.10'
         CONDA_ENV: 'testenv'
 
 - template: buildscripts/azure/azure-windows.yml
@@ -33,8 +27,8 @@ jobs:
     name: Windows
     vmImage: windows-2019
     matrix:
-      py37_np116_sp11:
-        PYTHON: '3.7'
-        NUMPY: '1.16'
-        SCIPY: '1.1'
+      py310_np123_sp1_10:
+        PYTHON: '3.10'
+        NUMPY: '1.23'
+        SCIPY: '1.10'
         CONDA_ENV: 'testenv'
diff --git a/buildscripts/azure/azure-linux-macos.yml b/buildscripts/azure/azure-linux-macos.yml
index 517d197..65de95d 100644
--- a/buildscripts/azure/azure-linux-macos.yml
+++ b/buildscripts/azure/azure-linux-macos.yml
@@ -15,6 +15,7 @@ jobs:
   steps:
     - script: |
         if [ "$(uname)" == "Linux" ] && [[ "$CONDA_SUBDIR" == "linux-32" || "$BITS32" == "yes" ]]; then sudo apt-get install -y libc6-dev-i386; fi
+        if [ "$(uname)" == "Linux" ] && [[ "$CONDA_SUBDIR" != "linux-32" || "$BITS32" != "yes" ]]; then sudo apt-get install -y glibc-tools; fi
         echo "Installing Miniconda"
         buildscripts/incremental/install_miniconda.sh
         export PATH=$HOME/miniconda3/bin:$PATH
diff --git a/buildscripts/conda_recipes/numba-scipy/meta.yaml b/buildscripts/conda_recipes/numba-scipy/meta.yaml
index 22c775f..e12e216 100644
--- a/buildscripts/conda_recipes/numba-scipy/meta.yaml
+++ b/buildscripts/conda_recipes/numba-scipy/meta.yaml
@@ -18,16 +18,16 @@ requirements:
   host:
     - python
     - numba
-    - scipy<=1.7.3
+    - scipy<1.11.0
     - setuptools
   run:
     - python
     - numba
-    - scipy<=1.7.3
+    - scipy<1.11.0
 
 test:
   requires:
-    - scipy<=1.7.3
+    - scipy<1.11.0
     - pytest
     - setuptools
     - faulthandler             # [py27 and (not (armv6l or armv7l))]
diff --git a/setup.py b/setup.py
index 8922664..4c971b5 100644
--- a/setup.py
+++ b/setup.py
@@ -2,25 +2,24 @@
 import versioneer
 
 
-_install_requires = ['scipy>=0.16,<=1.7.3', 'numba>=0.45']
+_install_requires = ["scipy>=0.16,<=1.11.0", "numba>=0.45"]
 
 
 metadata = dict(
-    name='numba-scipy',
+    name="numba-scipy",
     description="numba-scipy extends Numba to make it aware of SciPy",
     version=versioneer.get_version(),
     cmdclass=versioneer.get_cmdclass(),
-
     classifiers=[
         "Development Status :: 3 - Alpha",
         "Intended Audience :: Developers",
         "License :: OSI Approved :: BSD License",
         "Operating System :: OS Independent",
         "Programming Language :: Python",
-        "Programming Language :: Python :: 3.6",
-        "Programming Language :: Python :: 3.7",
         "Programming Language :: Python :: 3.8",
         "Programming Language :: Python :: 3.9",
+        "Programming Language :: Python :: 3.10",
+        "Programming Language :: Python :: 3.11",
         "Topic :: Software Development :: Compilers",
     ],
     package_data={},
@@ -42,8 +41,8 @@
 )
 
 
-with open('README.rst') as f:
-    metadata['long_description'] = f.read()
+with open("README.rst") as f:
+    metadata["long_description"] = f.read()
 
 
 setup(**metadata)


Test patch:
diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml
index a59a25d..316ea38 100644
--- a/.github/workflows/test_and_deploy.yml
+++ b/.github/workflows/test_and_deploy.yml
@@ -11,14 +11,15 @@ on:
       - '*'
 
 env:
-  MAIN_PYVER: 3.8
+  MAIN_PYVER: "3.10"
 
 jobs:
   build:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        scipy-version: [">=0.16,<1.4", ">=1.4,<=1.7.3"]
+        scipy-version: [">=1.4,<1.11.0"]
+        numpy-version: ["<1.22.0", ">=1.22.0"]
     steps:
       - name: Install glibc-tools
         shell: bash -l {0}
@@ -39,7 +40,7 @@ jobs:
       - name: Install dependencies
         shell: bash -l {0}
         run: |
-          conda install -c numba conda-build python=${{ env.MAIN_PYVER }} numba>=0.45 'scipy${{ matrix.scipy-version }}' flake8 pytest pip
+          conda install -c numba conda-build python=${{ env.MAIN_PYVER }} numba>=0.45 'scipy${{ matrix.scipy-version }}' 'numpy${{ matrix.numpy-version }}' flake8 pytest pip
           pip install --no-deps -e .
       - name: Lint with flake8
         shell: bash -l {0}
@@ -69,9 +70,27 @@ jobs:
     needs: build
     strategy:
       matrix:
-        scipy-version: [">=0.16,<1.4", ">=1.4,<=1.7.3"]
-        pyver: [3.6, 3.7, 3.8]
+        scipy-version: [">=1.4,<1.11.0"]
+        pyver: [3.8, 3.9, "3.10", 3.11]
         runs-on: [macos-latest, ubuntu-latest, windows-latest]
+        numpy-version: ["<1.22.0", ">=1.22.0"]
+        exclude:
+          - pyver: 3.11
+            numpy-version: "<1.22.0"
+        include:
+          - pyver: 3.8
+            scipy-version: ">=0.16,<1.4"
+            numpy-version: "<1.22.0"
+            runs-on: macos-latest
+          - pyver: 3.8
+            scipy-version: ">=0.16,<1.4"
+            numpy-version: "<1.22.0"
+            runs-on: ubuntu-latest
+          - pyver: 3.8
+            scipy-version: ">=0.16,<1.4"
+            numpy-version: "<1.22.0"
+            runs-on: windows-latest
+
     runs-on: ${{ matrix.runs-on }}
     steps:
       - name: Download build artifact
@@ -88,7 +107,7 @@ jobs:
       - name: Install dependencies and build artifact
         shell: bash -l {0}
         run: |
-          conda install -c numba python=${{ matrix.pyver }} numba>=0.45 'scipy${{ matrix.scipy-version }}' flake8 pytest
+          conda install -c numba python=${{ matrix.pyver }} numba>=0.45 'scipy${{ matrix.scipy-version }}' 'numpy${{ matrix.numpy-version }}' flake8 pytest
           # Install built_package
           BUILT_PKG=$(ls ./artifact_storage | head -1)
           conda install ./artifact_storage/$BUILT_PKG