From 60078c4ae6638760a542ce788701e2e44433eb4a Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Wed, 17 Apr 2024 09:59:40 -0400 Subject: [PATCH 01/15] CI: Add cygwin CI run --- .github/workflows/cygwin.yml | 68 ++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/cygwin.yml diff --git a/.github/workflows/cygwin.yml b/.github/workflows/cygwin.yml new file mode 100644 index 000000000000..20716a61e3e3 --- /dev/null +++ b/.github/workflows/cygwin.yml @@ -0,0 +1,68 @@ +name: Cygwin Tests + +on: + push: + branches: + - main + - maintenance/** + - cygwin-ci-test-* + pull_request: + branches: + - main + - maintenance/** + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + cygwin: + name: Cygwin tests + runs-on: windows-latest + env: + SHELLOPTS: igncr + CHERE_INVOKING: 1 + CYGWIN_NOWINPATH: 1 + PYTHONPATH: /usr/local/lib/python3.9/site-packages + steps: + - run: git config --global core.autocrlf input + - uses: actions/checkout@v3 + with: + submodules: recursive + - uses: cygwin/cygwin-install-action@v2 + with: + packages: >- + gcc-g++ gcc-fortran liblapack-devel libopenblas libmpfr-devel ccache swig libmpc-devel + libumfpack-devel libsliplu-devel libldl-devel libklu-devel libcxsparse-devel libcholmod-devel libamd-devel + python39-devel python39-pip python39-setuptools python39-wheel python39-numpy python39-cython + python39-pytest + meson ninja cmake make git + - name: Fix git config + shell: bash.exe -eo pipefail -o igncr "{0}" + run: /usr/bin/git config --system --add safe.directory /cygdrive/d/a/*/scipy + - name: Install Python dependencies + shell: bash.exe -eo pipefail -o igncr "{0}" + run: | + mkdir builds + cd builds + python3.9 -m pip install --upgrade pip 'setuptools<60' wheel + python3.9 -m pip install --upgrade numpy cython pytest pytest-xdist pytest-timeout pybind11 + python3.9 -m pip install --upgrade mpmath gmpy2 pythran threadpoolctl pooch + python3.9 -m pip uninstall -y nose + cd .. + - name: Check NumPy import + shell: bash.exe -eo pipefail -o igncr "{0}" + run: /usr/bin/env PATH="/bin:/usr/bin:/usr/local/bin:/usr/lib/lapack" python3.9 -c "import numpy as np; print(np.__version__)" + - name: Building SciPy + shell: bash.exe -eo pipefail -o igncr "{0}" + run: /usr/bin/env PATH="/bin:/usr/bin:/usr/local/bin:/usr/lib/lapack" python3.9 -u runtests.py -g -j2 --build-only + - name: Check SciPy installs + shell: bash.exe -eo pipefail -o igncr "{0}" + if: false + run: /usr/bin/env PATH="/bin:/usr/bin:/usr/local/bin:/usr/lib/lapack" python3.9 -m pip install -e . + - name: Testing SciPy + shell: bash.exe -eo pipefail -o igncr "{0}" + run: | + /usr/bin/env PATH="/bin:/usr/bin:/usr/local/bin:/usr/lib/lapack" python3. 9-u runtests.py -n -g -j2 -m fast -- -rfEX --durations=10 --timeout=60 2>&1 | tee runtests.log + python3.8 tools/validate_runtests_log.py fast < runtests.log From 85fef86e685f6174a6d370f70ec65041507ff77b Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Wed, 17 Apr 2024 10:40:15 -0400 Subject: [PATCH 02/15] CI: Switch cygwin to dev.py from runtests.py --- .github/workflows/cygwin.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cygwin.yml b/.github/workflows/cygwin.yml index 20716a61e3e3..8cdfe29ec22a 100644 --- a/.github/workflows/cygwin.yml +++ b/.github/workflows/cygwin.yml @@ -56,7 +56,7 @@ jobs: run: /usr/bin/env PATH="/bin:/usr/bin:/usr/local/bin:/usr/lib/lapack" python3.9 -c "import numpy as np; print(np.__version__)" - name: Building SciPy shell: bash.exe -eo pipefail -o igncr "{0}" - run: /usr/bin/env PATH="/bin:/usr/bin:/usr/local/bin:/usr/lib/lapack" python3.9 -u runtests.py -g -j2 --build-only + run: /usr/bin/env PATH="/bin:/usr/bin:/usr/local/bin:/usr/lib/lapack" python3.9 -u dev.py -j2 --show-build-log - name: Check SciPy installs shell: bash.exe -eo pipefail -o igncr "{0}" if: false @@ -64,5 +64,5 @@ jobs: - name: Testing SciPy shell: bash.exe -eo pipefail -o igncr "{0}" run: | - /usr/bin/env PATH="/bin:/usr/bin:/usr/local/bin:/usr/lib/lapack" python3. 9-u runtests.py -n -g -j2 -m fast -- -rfEX --durations=10 --timeout=60 2>&1 | tee runtests.log + /usr/bin/env PATH="/bin:/usr/bin:/usr/local/bin:/usr/lib/lapack" python3.9 -u dev.py test --durations=10 -j2 -m fast -b numpy -- -rfEX --timeout=60 2>&1 | tee runtests.log python3.8 tools/validate_runtests_log.py fast < runtests.log From 759dd33d6d5200760f9d975defd2de1e061e16a9 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Wed, 17 Apr 2024 12:26:04 -0400 Subject: [PATCH 03/15] CI:Cygwin:FIX: Install click --- .github/workflows/cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cygwin.yml b/.github/workflows/cygwin.yml index 8cdfe29ec22a..69bd7aa2659d 100644 --- a/.github/workflows/cygwin.yml +++ b/.github/workflows/cygwin.yml @@ -48,7 +48,7 @@ jobs: cd builds python3.9 -m pip install --upgrade pip 'setuptools<60' wheel python3.9 -m pip install --upgrade numpy cython pytest pytest-xdist pytest-timeout pybind11 - python3.9 -m pip install --upgrade mpmath gmpy2 pythran threadpoolctl pooch + python3.9 -m pip install --upgrade mpmath gmpy2 pythran threadpoolctl pooch click python3.9 -m pip uninstall -y nose cd .. - name: Check NumPy import From 86e9f0513e0a64ebd83980adec8c72c8adad9744 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Wed, 17 Apr 2024 13:11:29 -0400 Subject: [PATCH 04/15] FIX: Install doit --- .github/workflows/cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cygwin.yml b/.github/workflows/cygwin.yml index 69bd7aa2659d..f5c684429af2 100644 --- a/.github/workflows/cygwin.yml +++ b/.github/workflows/cygwin.yml @@ -48,7 +48,7 @@ jobs: cd builds python3.9 -m pip install --upgrade pip 'setuptools<60' wheel python3.9 -m pip install --upgrade numpy cython pytest pytest-xdist pytest-timeout pybind11 - python3.9 -m pip install --upgrade mpmath gmpy2 pythran threadpoolctl pooch click + python3.9 -m pip install --upgrade mpmath gmpy2 pythran threadpoolctl pooch click doit python3.9 -m pip uninstall -y nose cd .. - name: Check NumPy import From cf165dfb7d192ebe83e4385853e2c8df75a5d742 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Wed, 17 Apr 2024 13:57:38 -0400 Subject: [PATCH 05/15] FIX: Install rich-click and pydevtool --- .github/workflows/cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cygwin.yml b/.github/workflows/cygwin.yml index f5c684429af2..961e01f693e9 100644 --- a/.github/workflows/cygwin.yml +++ b/.github/workflows/cygwin.yml @@ -48,7 +48,7 @@ jobs: cd builds python3.9 -m pip install --upgrade pip 'setuptools<60' wheel python3.9 -m pip install --upgrade numpy cython pytest pytest-xdist pytest-timeout pybind11 - python3.9 -m pip install --upgrade mpmath gmpy2 pythran threadpoolctl pooch click doit + python3.9 -m pip install --upgrade mpmath gmpy2 pythran threadpoolctl pooch click doit rich-click pydevtool python3.9 -m pip uninstall -y nose cd .. - name: Check NumPy import From e03f9bbb809867508b7c65c8be4a3fad681e073a Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Wed, 17 Apr 2024 14:36:48 -0400 Subject: [PATCH 06/15] FIX: Don't specify parallelism --- .github/workflows/cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cygwin.yml b/.github/workflows/cygwin.yml index 961e01f693e9..e7e4e766608a 100644 --- a/.github/workflows/cygwin.yml +++ b/.github/workflows/cygwin.yml @@ -56,7 +56,7 @@ jobs: run: /usr/bin/env PATH="/bin:/usr/bin:/usr/local/bin:/usr/lib/lapack" python3.9 -c "import numpy as np; print(np.__version__)" - name: Building SciPy shell: bash.exe -eo pipefail -o igncr "{0}" - run: /usr/bin/env PATH="/bin:/usr/bin:/usr/local/bin:/usr/lib/lapack" python3.9 -u dev.py -j2 --show-build-log + run: /usr/bin/env PATH="/bin:/usr/bin:/usr/local/bin:/usr/lib/lapack" python3.9 -u dev.py --show-build-log - name: Check SciPy installs shell: bash.exe -eo pipefail -o igncr "{0}" if: false From f3836567397ed10d4ebeea645982b9c7d98503c1 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Wed, 17 Apr 2024 14:56:25 -0400 Subject: [PATCH 07/15] FIX: Tell dev.py to build scipy. --- .github/workflows/cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cygwin.yml b/.github/workflows/cygwin.yml index e7e4e766608a..9603c4f09e51 100644 --- a/.github/workflows/cygwin.yml +++ b/.github/workflows/cygwin.yml @@ -56,7 +56,7 @@ jobs: run: /usr/bin/env PATH="/bin:/usr/bin:/usr/local/bin:/usr/lib/lapack" python3.9 -c "import numpy as np; print(np.__version__)" - name: Building SciPy shell: bash.exe -eo pipefail -o igncr "{0}" - run: /usr/bin/env PATH="/bin:/usr/bin:/usr/local/bin:/usr/lib/lapack" python3.9 -u dev.py --show-build-log + run: /usr/bin/env PATH="/bin:/usr/bin:/usr/local/bin:/usr/lib/lapack" python3.9 -u dev.py build --show-build-log - name: Check SciPy installs shell: bash.exe -eo pipefail -o igncr "{0}" if: false From e45e1f6bed639e5a7f3b82117cb43a7ea01c89ec Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Wed, 17 Apr 2024 15:22:46 -0400 Subject: [PATCH 08/15] BLD:BUG: Move Python.h earlier in special/ufunc.h --- scipy/special/ufunc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scipy/special/ufunc.h b/scipy/special/ufunc.h index 62781e2b8987..f879a80b9ed6 100644 --- a/scipy/special/ufunc.h +++ b/scipy/special/ufunc.h @@ -1,3 +1,6 @@ +#define PY_SSIZE_T_CLEAN +#include + #include #include #include @@ -5,9 +8,6 @@ #include #include -#define PY_SSIZE_T_CLEAN -#include - #include #include #include From f337aa1b891b033c3fda8432dd66a003e32ac251 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Wed, 17 Apr 2024 15:24:48 -0400 Subject: [PATCH 09/15] CI: Add pip cache to Cygwin CI --- .github/workflows/cygwin.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/cygwin.yml b/.github/workflows/cygwin.yml index 9603c4f09e51..30de73807ffe 100644 --- a/.github/workflows/cygwin.yml +++ b/.github/workflows/cygwin.yml @@ -41,6 +41,14 @@ jobs: - name: Fix git config shell: bash.exe -eo pipefail -o igncr "{0}" run: /usr/bin/git config --system --add safe.directory /cygdrive/d/a/*/scipy + - name: pip cache + uses: actions/cache@v4 + with: + path: 'C:\cygwin\home\runneradmin\.cache\pip' + key: ${{ runner.os }}-cygwin-pip3.9-${{ hashFiles('.github/workflows/cygwin.yml') }} + restore-keys: | + ${{ runner.os }}-cygwin-pip3.9- + - name: Install Python dependencies shell: bash.exe -eo pipefail -o igncr "{0}" run: | From ce1ce9d74c3529355df10ce879b9f3d9fe3f69dd Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Wed, 17 Apr 2024 15:56:55 -0400 Subject: [PATCH 10/15] BLD:BUG: Include Python.h first in special/_gufuncs.cpp --- scipy/special/_gufuncs.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scipy/special/_gufuncs.cpp b/scipy/special/_gufuncs.cpp index 205ca839b3e7..8fe2ef1ce56f 100644 --- a/scipy/special/_gufuncs.cpp +++ b/scipy/special/_gufuncs.cpp @@ -1,7 +1,8 @@ +#include +#include "ufunc.h" #include "special/bessel.h" #include "special/legendre.h" #include "special/sph_harm.h" -#include "ufunc.h" using namespace std; From eebfad0d0bad4030fd32d10eeac1e98650bcfa58 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Wed, 17 Apr 2024 16:38:00 -0400 Subject: [PATCH 11/15] CI:BUG: Include Python.h first in special/_special_ufuncs.cpp --- scipy/special/_special_ufuncs.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scipy/special/_special_ufuncs.cpp b/scipy/special/_special_ufuncs.cpp index 688c6b2bd6bc..a39af490516b 100644 --- a/scipy/special/_special_ufuncs.cpp +++ b/scipy/special/_special_ufuncs.cpp @@ -1,3 +1,6 @@ +#include +#include "ufunc.h" + #include #include "sf_error.h" @@ -22,7 +25,6 @@ #include "special/trig.h" #include "special/wright_bessel.h" #include "special/zeta.h" -#include "ufunc.h" // This is the extension module for the NumPy ufuncs in SciPy's special module. To create such a ufunc, call // "SpecFun_NewUFunc" with a braced list of kernel functions that will become the ufunc overloads. There are From 3ce0e06d50a832a7a5a3cd17152b665a413fc189 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Wed, 17 Apr 2024 16:51:04 -0400 Subject: [PATCH 12/15] BUG: Move header including Python.h first in _wright.cxx --- scipy/special/_wright.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scipy/special/_wright.cxx b/scipy/special/_wright.cxx index 68ba3fc4ba45..4669232c321d 100644 --- a/scipy/special/_wright.cxx +++ b/scipy/special/_wright.cxx @@ -1,7 +1,7 @@ -#include - #include "_wright.h" +#include + using namespace std; extern "C" { From c756e79252f890101aab450ecb648fd5c6c9e16d Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Wed, 17 Apr 2024 16:58:05 -0400 Subject: [PATCH 13/15] BUG: Include complex in special/_special_ufuncs.cpp --- scipy/special/_special_ufuncs.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/scipy/special/_special_ufuncs.cpp b/scipy/special/_special_ufuncs.cpp index a39af490516b..657ccb6949d9 100644 --- a/scipy/special/_special_ufuncs.cpp +++ b/scipy/special/_special_ufuncs.cpp @@ -2,6 +2,7 @@ #include "ufunc.h" #include +#include #include "sf_error.h" #include "special/airy.h" From b759c169746e7cbf3da34f57b218d10051c9b339 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Wed, 17 Apr 2024 17:34:53 -0400 Subject: [PATCH 14/15] BUG: Include complex in special/ufunc.h --- scipy/special/ufunc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/scipy/special/ufunc.h b/scipy/special/ufunc.h index f879a80b9ed6..7faf9e387b7e 100644 --- a/scipy/special/ufunc.h +++ b/scipy/special/ufunc.h @@ -2,6 +2,7 @@ #include #include +#include #include #include #include From 70f55bd569627dded283cfee43c44eb0ec07bca5 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Wed, 17 Apr 2024 17:44:14 -0400 Subject: [PATCH 15/15] CI: Run only on pull-request I had it running on pushes before I made the PR; that's redundant now. --- .github/workflows/cygwin.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cygwin.yml b/.github/workflows/cygwin.yml index 30de73807ffe..aff99434b8ed 100644 --- a/.github/workflows/cygwin.yml +++ b/.github/workflows/cygwin.yml @@ -5,7 +5,6 @@ on: branches: - main - maintenance/** - - cygwin-ci-test-* pull_request: branches: - main