diff --git a/.github/workflows/array_api.yml b/.github/workflows/array_api.yml deleted file mode 100644 index b720d6b1bf00..000000000000 --- a/.github/workflows/array_api.yml +++ /dev/null @@ -1,87 +0,0 @@ -name: Array API - -on: - push: - branches: - - maintenance/** - pull_request: - branches: - - main - - maintenance/** - schedule: - # ┌───────────── minute (0 - 59) - # │ ┌───────────── hour (0 - 23) - # │ │ ┌───────────── day of the month (1 - 31) - # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) - # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) - # │ │ │ │ │ - - cron: "47 11 2/2 * *" - -permissions: - contents: read # to fetch code (actions/checkout) - -env: - CCACHE_DIR: "${{ github.workspace }}/.ccache" - CCACHE_MAXSIZE: "250M" - JAX_COMPILATION_CACHE_DIR: "${{ github.workspace }}/.cache/scipy_jax_cache" - JAX_PERSISTENT_CACHE_MIN_COMPILE_TIME_SECS: "0" - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - get_commit_message: - name: Get commit message - uses: ./.github/workflows/commit_message.yml - - xp_cpu: - name: ${{ join(matrix.tasks, ' ') }} - needs: get_commit_message - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - include: - - tasks: [test-strict, test-torch, test-torch-float32, test-torch-meta, test-dask, test-mparray] - environments: [array-api-strict, torch-cpu, dask-cpu, mparray] - - tasks: [test-jax] - environments: [jax-cpu] - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - persist-credentials: false - - - uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2 - with: - pixi-version: v0.71.0 - cache: false - environments: build-cpu ${{ join(matrix.environments, ' ') }} - - - name: Set up ccache - uses: ./.github/ccache - with: - workflow_name: ${{ github.workflow }} - job_name: ${{ github.job }} - - - name: Build - run: pixi run build-cpu - - - name: Test - run: | - export OMP_NUM_THREADS=2 - for task in ${TASKS}; do - pixi run --skip-deps "$task" -j 3 -- --durations 3 --timeout=120 --dist worksteal - done - env: - TASKS: ${{ join(matrix.tasks, ' ') }} - - - name: Ccache performance - shell: bash -l {0} - run: | - pixi exec ccache --evict-older-than 1d - pixi exec ccache -s diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index 019104f5fdaa..000000000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,115 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL Advanced" - -on: - push: - branches: ["main"] - -permissions: {} - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - analyze: - name: Analyze (${{ matrix.language }}) - # Runner size impacts CodeQL analysis time. To learn more, please see: - # - https://gh.io/recommended-hardware-resources-for-running-codeql - # - https://gh.io/supported-runners-and-hardware-resources - # - https://gh.io/using-larger-runners (GitHub.com only) - # Consider using larger runners or machines with greater resources for possible analysis time improvements. - runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} - permissions: - security-events: write # required for all workflows - packages: read # required to fetch internal or private CodeQL packs - - strategy: - fail-fast: false - matrix: - include: - - language: actions - build-mode: none - - language: c-cpp - build-mode: manual - - language: python - build-mode: none - # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift' - # Use `c-cpp` to analyze code written in C, C++ or both - # Use 'java-kotlin' to analyze code written in Java, Kotlin or both - # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both - # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, - # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. - # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how - # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages - steps: - - name: Checkout repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - # Add any setup steps before running the `github/codeql-action/init` action. - # This includes steps like installing compilers or runtimes (`actions/setup-node` - # or others). This is typically only required for manual builds. - # - name: Setup runtime (example) - # uses: actions/setup-example@v1 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@1c5b675653bb5c22dbe9b12b556ec555138e09fd # v4.38.1 - with: - languages: ${{ matrix.language }} - build-mode: ${{ matrix.build-mode }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - # If the analyze step fails for one of the languages you are analyzing with - # "We were unable to automatically build your code", modify the matrix above - # to set the build mode to "manual" for that language. Then modify this step - # to build your code. - # ℹ️ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - if: matrix.build-mode == 'manual' - name: Checkout submodules - shell: bash - run: git submodule update --init - - - if: matrix.build-mode == 'manual' - name: Install Ubuntu dependencies - uses: ./.github/apt-get - with: - packages: gcc g++ libopenblas-dev liblapack-dev pkg-config python3-pip python3-dev - - - if: matrix.build-mode == 'manual' - name: Build SciPy - shell: bash - run: | - python -m pip install --upgrade pip - python -m pip install --group build --group dev-cli - spin build - - - if: matrix.language == 'c-cpp' - name: Work around CodeQL C++ trap cache finalize crash (ensure tarballs dir exists) - shell: bash - run: | - set -euxo pipefail - mkdir -p "${RUNNER_TEMP}/trapCaches/cpp/tarballs" - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@1c5b675653bb5c22dbe9b12b556ec555138e09fd # v4.38.1 - with: - category: "/language:${{matrix.language}}" diff --git a/.github/workflows/emscripten.yml b/.github/workflows/emscripten.yml index 1dd6a2054954..edb12c8ceac0 100644 --- a/.github/workflows/emscripten.yml +++ b/.github/workflows/emscripten.yml @@ -3,20 +3,14 @@ name: Emscripten/Pyodide on: push: branches: - - main - - maintenance/** - pull_request: - branches: - - main - - maintenance/** + - wasm-ci-unsplit-* workflow_dispatch: permissions: contents: read # to fetch code (actions/checkout) -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true +# No concurrency group on purpose: every push must keep all previous +# sampling runs alive instead of cancelling them. env: FORCE_COLOR: 3 @@ -29,13 +23,17 @@ jobs: uses: ./.github/workflows/commit_message.yml build_wasm: - name: Build & test SciPy for Pyodide + name: Sample ${{ matrix.run }} needs: get_commit_message if: > needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') + && github.repository == 'agriyakhetarpal/scipy' runs-on: ubuntu-latest timeout-minutes: 45 + strategy: + fail-fast: false + matrix: + run: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: diff --git a/.github/workflows/gpu-ci.yml b/.github/workflows/gpu-ci.yml deleted file mode 100644 index 233ebf377776..000000000000 --- a/.github/workflows/gpu-ci.yml +++ /dev/null @@ -1,136 +0,0 @@ -name: GPU jobs - -# Updating the Pixi lock file: -# -# 1. Please try to avoid this unless it's actually necessary. Updating the lock -# file generates a large diff, and triggers a lot of large package downloads -# (also for local testing by maintainers). -# 2. Consider committing the `pixi.toml` change in one commit, and the -# `pixi.lock` change in a second commit. This allows the reviewer to redo -# the lock file changes locally, or discard them in case of conflicts while -# still keeping the `pixi.toml` changes. -# -# -# In order to run a CI job step locally on a Linux machine with an NVIDIA GPU: -# -# $ cd .github/workflows -# $ pixi run build -# $ pixi run -e cupy test-cupy -v -m "array_api_backends and not slow" -# -# Or run different test commands in the same environments, e.g.: -# -# $ pixi run test-torch-cuda -s special -# $ pixi run test-torch -s special -# -# To see available tasks per environment: -# -# $ pixi task ls -s - -on: - push: - branches: - - maintenance/** - pull_request: - branches: - - main - - maintenance/** - -permissions: - contents: read # to fetch code (actions/checkout) - -env: - CCACHE_DIR: "${{ github.workspace }}/.ccache" - CCACHE_MAXSIZE: "350M" - # Enable persistent cache - # https://docs.jax.dev/en/latest/config_options.html - JAX_COMPILATION_CACHE_DIR: "${{ github.workspace }}/.cache/scipy_jax_cache" - - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - get_commit_message: - name: Get commit message - uses: ./.github/workflows/commit_message.yml - - pytorch_gpu: - name: PyTorch, JAX, CuPy GPU - needs: get_commit_message - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - runs-on: "cirun-scipy-onprem-gpu--${{ github.run_id }}" - steps: - - name: Checkout scipy repo - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - persist-credentials: false - - - name: Setup compiler cache - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - with: - path: ${{ env.CCACHE_DIR }} - # Use a per-run key so newly generated cache entries are saved. - # The restore prefix below retrieves the most recent prior cache. - key: ${{ runner.os }}-gpu-ccache-1-${{ github.run_id }} - restore-keys: | - ${{ runner.os }}-gpu-ccache-1- - - - name: Define default CuPy cache path - run: | - # We don't want to change the directory, and $HOME isn't available in - # `env:` above - echo "CUPY_CACHE_DIR=$HOME/.cupy/kernel_cache" >> $GITHUB_ENV - - - name: Cache CuPy kernels - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - with: - path: ${{ env.CUPY_CACHE_DIR }} - key: ${{ runner.os }}-gpu-cupy-1-${{ github.run_id }} - restore-keys: | - ${{ runner.os }}-gpu-cupy-1- - - - name: Cache JAX kernels - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - with: - path: ${{ env.JAX_COMPILATION_CACHE_DIR }} - key: ${{ runner.os }}-gpu-jax-1-${{ github.run_id }} - restore-keys: | - ${{ runner.os }}-gpu-jax-1- - - - name: run nvidia-smi - run: nvidia-smi - - - name: run nvidia-smi --query - run: nvidia-smi --query - - - uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2 - with: - pixi-version: v0.71.0 - cache: true - cache-key: gpu-pixi-1- - environments: >- - build-cuda - torch-cuda - jax-cuda - cupy - - - name: Build SciPy - run: pixi run build-cuda - - - name: Run PyTorch GPU tests - run: pixi run --skip-deps test-torch-cuda -v - - - name: Run CuPy tests - run: pixi run --skip-deps test-cupy -v - - - name: Run JAX GPU tests - env: - # Give 10% of GPU memory to each pytest worker to ensure fairness. - XLA_PYTHON_CLIENT_MEM_FRACTION: .10 - # Minimum compile time to store entry to cache - JAX_PERSISTENT_CACHE_MIN_COMPILE_TIME_SECS: "0" - run: pixi run --skip-deps test-jax-cuda -v -j 4 -- --dist worksteal diff --git a/.github/workflows/issue-labeler.yml b/.github/workflows/issue-labeler.yml deleted file mode 100644 index 9f96de62b992..000000000000 --- a/.github/workflows/issue-labeler.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: "Issue Labeler" -on: - issues: - types: [opened] - -permissions: {} - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - label_issue: - name: "Label Issue" - # Permissions needed for labelling issues automatically - # https://docs.github.com/en/actions/security-guides/automatic-token-authentication - permissions: - contents: read - issues: write # needed to apply label - runs-on: ubuntu-latest - steps: - # label based on issue title - - uses: github/issue-labeler@ccca1e16fcb66762200e616fc29b57b940c1cb67 # v3.5 - if: github.repository == 'scipy/scipy' - with: - configuration-path: .github/label-title.yml - include-title: 1 - include-body: 0 - enable-versioned-regex: 0 - repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/label-pr-on-close.yml b/.github/workflows/label-pr-on-close.yml deleted file mode 100644 index 523b738e21fd..000000000000 --- a/.github/workflows/label-pr-on-close.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: "Label PR on Close" -on: - pull_request_target: - types: [closed] - -permissions: {} - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - label_pull_request: - name: "Label PR on Close" - # Permissions needed for labelling Pull Requests automatically - # https://docs.github.com/en/actions/security-guides/automatic-token-authentication - permissions: - contents: read - pull-requests: write # needed to apply label - runs-on: ubuntu-latest - steps: - - uses: github/issue-labeler@ccca1e16fcb66762200e616fc29b57b940c1cb67 # v3.5 - if: > - github.repository == 'scipy/scipy' - && github.event.pull_request.merged == true - with: - configuration-path: .github/label-title-on-close.yml - include-title: 1 - include-body: 0 - enable-versioned-regex: 0 - repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/label-pr-on-open.yml b/.github/workflows/label-pr-on-open.yml deleted file mode 100644 index e8186de314a1..000000000000 --- a/.github/workflows/label-pr-on-open.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: "Label PR on Open" -on: - pull_request_target: - types: [opened] - -permissions: {} - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - label_pull_request: - name: Label PR - # Permissions needed for labelling Pull Requests automatically - # https://docs.github.com/en/actions/security-guides/automatic-token-authentication - permissions: - contents: read - pull-requests: write # needed to apply label - runs-on: ubuntu-latest - steps: - # label based on changed files - - uses: actions/labeler@bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13 # v7.0.0 - continue-on-error: true - if: github.repository == 'scipy/scipy' - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" - configuration-path: ".github/label-filename.yml" - # label based on PR title - - uses: github/issue-labeler@ccca1e16fcb66762200e616fc29b57b940c1cb67 # v3.5 - if: github.repository == 'scipy/scipy' - with: - configuration-path: .github/label-title.yml - include-title: 1 - include-body: 0 - enable-versioned-regex: 0 - repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 22bf1be6c607..000000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Lint - -on: - push: - branches: - - maintenance/** - pull_request: - branches: - - main - - maintenance/** - -permissions: - contents: read # to fetch code (actions/checkout) - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - test_lint: - name: Lint - # If using act to run CI locally the github object does not exist and the usual skipping should not be enforced - if: "github.repository == 'scipy/scipy' || github.repository == ''" - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - fetch-depth: 0 # previous commits used in tools/linting/lint.py - submodules: recursive - persist-credentials: false - - - uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2 - with: - pixi-version: v0.71.0 - cache: false - environments: lint - - - name: Spin Lint - run: | - set -euo pipefail - pixi run lint --diff-against origin/$GITHUB_BASE_REF - - - name: Check that Python.h is first in any file including it. - shell: bash - run: pixi run check-python-h - - - name: Check module interdependencies - run: pixi run tach-check - - - name: Check external dependencies - run: pixi run tach-check-external - - - name: GitHub Actions static analysis - run: | - pixi run actionlint - pixi run zizmor diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml deleted file mode 100644 index 024872bc2d6f..000000000000 --- a/.github/workflows/linux.yml +++ /dev/null @@ -1,734 +0,0 @@ -name: Linux tests - -on: - push: - branches: - - main - - maintenance/** - pull_request: - branches: - - main - - maintenance/** - -permissions: - contents: read # to fetch code (actions/checkout) - -env: - CCACHE_DIR: "${{ github.workspace }}/.ccache" - CCACHE_MAXSIZE: "250M" - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - get_commit_message: - name: Get commit message - uses: ./.github/workflows/commit_message.yml - - test_meson: - name: pyrefly (py3.12) & dev deps (py3.15), fast, spin - needs: get_commit_message - # If using act to run CI locally the github object does not exist and - # the usual skipping should not be enforced - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - runs-on: ubuntu-24.04 - strategy: - matrix: - python-version: ["3.12", "3.15-dev"] # this run will use python dev versions when available - maintenance-branch: - - ${{ contains(github.ref, 'maintenance/') || contains(github.base_ref, 'maintenance/') }} - exclude: - - maintenance-branch: true - python-version: "3.15-dev" - - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 - with: - python-version: ${{ matrix.python-version }} - allow-prereleases: true - - - name: Install Ubuntu dependencies - # NOTE: not the same OpenBLAS version as in upstream CI (I'm being lazy here) - uses: ./.github/apt-get - with: - packages: >- - libopenblas-dev libatlas-base-dev liblapack-dev libgmp-dev - libmpfr-dev libsuitesparse-dev ccache libmpc-dev - - - name: Install Python packages - if: matrix.python-version == '3.12' - run: | - python -m pip install --group build --group dev-cli --group test-core --group test-mp --group optional-runtime-deps - - - name: Install Python packages from repositories - if: matrix.python-version == '3.15-dev' # this run will use python dev versions when available - run: | - python -m pip install --group build --group dev-cli --group test-core --group test-mp - python -m pip install git+https://github.com/numpy/numpy.git - python -m pip install git+https://github.com/serge-sans-paille/pythran.git - python -m pip install git+https://github.com/mesonbuild/meson.git - - - name: Set up ccache - uses: ./.github/ccache - with: - workflow_name: ${{ github.workflow }} - job_name: ${{ github.job }}-${{ matrix.python-version }} - - - name: Setup build and install scipy - run: | - spin build --release - - - name: Ccache performance - shell: bash -l {0} - run: | - ccache --evict-older-than 1d - ccache -s - - - name: Check installed files - run: | - spin check --installed-files --no-build - - - name: Check symbol hiding - run: | - spin check --symbol-hiding --no-build - - - name: Check usage of install tags - run: | - rm -r build-install - spin build --tags=runtime,python-runtime,devel - python tools/linting/check_installation.py build-install --no-tests - rm -r build-install - spin build --tags=runtime,python-runtime,devel,tests - spin check --installed-files --no-build - - - name: Check xp markers - run: | - spin check --xp-markers --no-build - - - name: Check build-internal dependencies - run: ninja -C build -t missingdeps - - - name: Pyrefly - if: matrix.python-version == '3.12' - run: | - python -m pip install --group typecheck - pyrefly check --output-format=github - - - name: Report CPU details - run: | - # Diagnostics for CPU-dependent failures (gh-26286) - lscpu - spin python --no-build -- -c "import numpy as np; import scipy.linalg; np.show_runtime()" - - - name: Test SciPy - run: | - export OMP_NUM_THREADS=2 - python -m pip uninstall --yes uarray # avoid deprecation warnings - spin test -j3 -- --durations 10 --timeout=60 - - ################################################################################# - test_venv_install: - name: Install into venv, cluster only, pyAny/npAny, pip+cluster.test() - needs: get_commit_message - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - persist-credentials: false - - - name: Install Ubuntu dependencies - # We're not running the full test suite here, only testing the install - # into a venv is working, so leave out optional dependencies. That's - # also why we can get away with an old version of OpenBLAS from Ubuntu - uses: ./.github/apt-get - with: - packages: python3-dev libopenblas-dev pkg-config ccache - - - name: Set up ccache - uses: ./.github/ccache - with: - workflow_name: ${{ github.workflow }} - job_name: ${{ github.job }} - - - name: Create venv, install SciPy - run: | - python -m venv ../venvs/scipy-venv - source ../venvs/scipy-venv/bin/activate - python -m pip install --upgrade pip - python -m pip install --group test-core - # Note that this uses build isolation. That's why we don't need build - # dependencies to be installed in the venv itself. - python -m pip install . -vv -Csetup-args=--werror - - - name: Basic imports and tests - run: | - source ../venvs/scipy-venv/bin/activate - cd .. - python -c "import scipy" - python -c "import scipy.linalg" - python -c "from scipy import cluster; cluster.test()" - - - name: Create venv inside source tree - # This is a regression test for gh-16312 - run: | - python -m venv .venv - source .venv/bin/activate - # Install build dependencies. Use meson-python from its main branch, - # most convenient to test in this job because we're using pip without - # build isolation here. - python -m pip install --upgrade pip - python -m pip install --group build --group test-core - python -m pip install git+https://github.com/mesonbuild/meson-python.git - # Non-isolated build, so we use dependencies installed inside the source tree - python -m pip install . -v --no-build-isolation - - # Basic tests - cd .. - python -c "import scipy" - python -c "import scipy.linalg" - python -c "from scipy import cluster; cluster.test()" - - - name: Ccache performance - shell: bash -l {0} - run: | - ccache --evict-older-than 1d - ccache -s - - ################################################################################# - test_editable_install: - # Editable installs hit corner cases that regular installs don't, e.g., gh-25892 - name: Editable install, fast, py3.12/npAny, spin - needs: get_commit_message - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 - with: - python-version: "3.12" - - - name: Install Ubuntu dependencies - # apt OpenBLAS rather than the scipy-openblas wheel, because - # `--with-scipy-openblas` is a `spin build` flag with no `spin install` equivalent - uses: ./.github/apt-get - with: - packages: libopenblas-dev pkg-config ccache - - - name: Install Python packages - run: | - python -m pip install --group build --group dev-cli --group test-core --group optional-runtime-deps - - - name: Set up ccache - uses: ./.github/ccache - with: - workflow_name: ${{ github.workflow }} - job_name: ${{ github.job }} - - - name: Editable install - # `spin install` defaults to `pip install -e . --no-build-isolation` - run: | - spin install - - - name: Check import - # Run from outside the source tree, then check that `scipy` still - # resolves back to it - that's the point of an editable install. - run: | - python -c " - import os, pathlib, scipy, scipy.linalg - expected = pathlib.Path(os.environ['EXPECTED_SCIPY_DIR']) - assert pathlib.Path(scipy.__file__).parent == expected, \ - f'{scipy.__file__=} not from {expected}'" - working-directory: ${{ runner.temp }} - env: - EXPECTED_SCIPY_DIR: ${{ github.workspace }}/scipy - - - name: Check rebuild on import - # meson-python reruns ninja on every import of an editable install. Touch a - # source file (Pythran-compiled here, rather than Cython, but the rebuild - # hook works the same way) so that hook has actual work to do, then check - # the compiled extension's mtime to prove a rebuild actually happened - - # not just that the (possibly stale) module still imports without error. - run: | - before=$(python -c " - import scipy.signal._max_len_seq_inner as m, os - print(os.stat(m.__file__).st_mtime_ns)") - sleep 1 # ensure a rebuilt file's mtime is unambiguously newer - touch "$GITHUB_WORKSPACE/scipy/signal/_max_len_seq_inner.py" - after=$(python -c " - import scipy.signal, scipy.signal._max_len_seq_inner as m, os - assert len(scipy.signal.max_len_seq(4)[0]) == 15 - print(os.stat(m.__file__).st_mtime_ns)") - echo "extension mtime (ns): before=$before after=$after" - if [[ "$after" -le "$before" ]]; then - echo "::error::extension was not rebuilt on import (mtime unchanged)" - exit 1 - fi - working-directory: ${{ runner.temp }} - - - name: Ccache performance - # After the imports above, since those can trigger a rebuild - shell: bash -l {0} - run: | - ccache --evict-older-than 1d - ccache -s - - - name: Test SciPy - # `-t scipy` is required: with extra args after `--`, spin does not add a - # collection target of its own, and for an editable install it also leaves - # pytest's cwd at the repo root - so pytest would collect the whole checkout. - run: | - spin test -j3 -t scipy -- --durations 10 --timeout=60 - - ################################################################################# - python_debug: - # also uses the vcs->sdist->wheel route. - name: Python-debug & ATLAS & sdist+wheel, fast, py3.12/npMin, pip+pytest - needs: get_commit_message - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - runs-on: ubuntu-24.04 # provides python3.12-dbg - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - persist-credentials: false - - - name: Configuring Test Environment - uses: ./.github/apt-get - with: - packages: >- - python3-dbg python3-dev libatlas-base-dev liblapack-dev - libgmp-dev libmpfr-dev libmpc-dev - - - name: Check python3-dbg - run: | - python3-dbg --version # just to check - python3-dbg -c 'import sys; print("Python debug build:", hasattr(sys, "gettotalrefcount"))' - - - name: Build SciPy - run: | - python3-dbg -m pip install --upgrade pip - python3-dbg -m pip install build - # Note: we are testing installion via sdist, so can't use `ccache` in this job - python3-dbg -m build -Csetup-args=-Dbuildtype=debugoptimized -Csetup-args=-Dblas=blas-atlas -Csetup-args=-Dlapack=lapack-atlas - python3-dbg -m pip install dist/scipy*.whl - - - name: Testing SciPy - run: | - python3-dbg -m pip install --group test - cd doc # move out of source root directory - python3-dbg -m pytest --pyargs scipy -n4 --durations=10 -m "not slow" - - ################################################################################# - gcc10: - # Purpose is to examine builds with oldest-supported gcc and test with pydata/sparse. - name: Oldest GCC & pydata/sparse, full, py3.12/npMin, pip+pytest - needs: get_commit_message - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 - with: - python-version: "3.12" - - - name: Setup system dependencies - uses: ./.github/apt-get - with: - packages: >- - g++-10 gcc-10 libatlas-base-dev liblapack-dev libgmp-dev - libmpfr-dev libmpc-dev pkg-config libsuitesparse-dev ccache - - - name: Setup Python build deps - run: pip install --group build - - - name: Set up ccache - uses: ./.github/ccache - with: - workflow_name: ${{ github.workflow }} - job_name: ${{ github.job }} - - - name: Build wheel and install - run: | - set -euo pipefail - export PYTHONOPTIMIZE=2 - - # specify which compilers to use using environment variables - CC="ccache gcc-10" CXX="ccache g++-10" python -m pip install . -v \ - --no-build-isolation -Cbuild-dir=build \ - -Csetup-args=-Dblas=blas-atlas -Csetup-args=-Dlapack=lapack-atlas - - - name: Ccache performance - shell: bash -l {0} - run: | - ccache --evict-older-than 1d - ccache -s - - - name: Install test dependencies - run: | - pip install --group test - # Downgrade numpy to oldest supported version - pip install "numpy==2.0.0" - - - name: Run tests - run: | - # can't be in source directory - pushd $RUNNER_TEMP - export PYTHONOPTIMIZE=2 - python -m pytest --pyargs scipy -n4 --durations=10 - popd - - ################################################################################# - prerelease_deps_coverage_64bit_blas: - # TODO: re-enable ILP64 build. - name: Prerelease deps & coverage report, full, py3.12/npMin & py3.13/npPre, spin, SCIPY_ARRAY_API=1 - needs: get_commit_message - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.12"] - - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 - with: - python-version: ${{ matrix.python-version }} - - - name: Install Ubuntu dependencies - uses: ./.github/apt-get - with: - packages: libgmp-dev libmpfr-dev libmpc-dev ccache lcov - - - name: Install Python packages - run: | - python -m pip install --upgrade pip - python -m pip install --group build --group dev-cli --group openblas32 - python -m pip install --pre --upgrade --group coverage - python -m pip install --pre --upgrade --timeout=60 -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy - - - name: Set up ccache - uses: ./.github/ccache - with: - workflow_name: ${{ github.workflow }} - job_name: ${{ github.job }} - - - name: Build and install SciPy - run: | - spin build --gcov --with-scipy-openblas=32 --release - - - name: Ccache performance - shell: bash -l {0} - run: | - ccache --evict-older-than 1d - ccache -s - - - name: Downgrade NumPy to lowest supported - run: | - python -m pip install "numpy==2.0.0" - - - name: Test SciPy - run: | - export OPENBLAS_NUM_THREADS=1 - export SCIPY_ARRAY_API=1 - spin test --no-build --coverage -j2 --mode full -- --cov --cov-report term-missing - - ################################################################################# - linux_32bit: - name: 32-bit, fast, py3.12/npMin, spin - needs: get_commit_message - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - runs-on: ubuntu-latest - # I tried running directly in a container:, using the image: and options: - # entries. Unfortunately at this time options: does not seem to listen to - # --platform linux/i386. - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - persist-credentials: false - - - name: build + test in i686 container - run: | - set -exuo pipefail - docker pull quay.io/pypa/manylinux_2_28_i686 - docker run -v "$(pwd):/scipy" --platform=linux/i386 quay.io/pypa/manylinux_2_28_i686 /bin/bash -c ' - set -exuo pipefail - cd /scipy - uname -a - python3.12 -m venv test - source test/bin/activate - python -m pip install --upgrade pip - python -m pip install --group build --group dev-cli --group test-core --group openblas32 - # we want `mpmath` but cannot install `gmpy2` on 32-bit, - # so cannot use `--group test-mp` - python -m pip install mpmath - python -m pip install numpy==2.0.0 -Cbuild-dir=numpy-builddir - python -c "import numpy as np; np.show_config()" - spin build --with-scipy-openblas=32 - spin test - ' - - ################################################################################# - distro_multiple_pythons: - # Purpose is to build for a non-default Python interpreter in a Linux distro - # For such a build config, `python`/`python3` executables may not have - # build dependencies like Cython or NumPy installed. - name: non-default Python interpreter, fast, py3.12/npMin, pip+pytest - needs: get_commit_message - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - persist-credentials: false - - - name: Setup system dependencies - uses: ./.github/apt-get - with: - repository: ppa:deadsnakes/ppa - packages: >- - python3.12-dev ninja-build pkg-config libatlas-base-dev - liblapack-dev ccache - - - name: Set up ccache - uses: ./.github/ccache - with: - workflow_name: ${{ github.workflow }} - job_name: ${{ github.job }} - - - name: Setup Python build deps - run: | - python3.12 -m pip install --upgrade pip - python3.12 -m pip install build - python3.12 -m pip install --group build - - - name: Build wheel and install - run: | - python3.12 -m build -wnx -Csetup-args=-Dblas=blas-atlas -Csetup-args=-Dlapack=lapack-atlas - python3.12 -m pip install dist/*.whl - - - name: Ccache performance - shell: bash -l {0} - run: | - ccache --evict-older-than 1d - ccache -s - - - name: Install test dependencies - run: | - python3.12 -m pip install --group test-core - - - name: Run tests - run: | - # Just a small subset of tests; this will be fine if the build - # succeeds (that's the real purpose of this job) - pushd $RUNNER_TEMP - python3.12 -m pytest --pyargs scipy.cluster - python3.12 -m pytest --pyargs scipy.linalg - popd - - ################################################################################# - meson_global_install: - # Check that `meson` can be used from anywhere. The environment Meson is - # installed in doesn't have to have any other build dependencies in it - # (i.e., we're using it as a binary). This isn't a normal setup, but it's - # sometimes being used that way - see gh-20535 and gh-24406 - name: build with global meson - needs: get_commit_message - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - fetch-tags: true - persist-credentials: false - - - name: Install system dependencies - uses: ./.github/apt-get - with: - packages: pkg-config libopenblas-dev liblapack-dev ccache - - - name: Set up ccache - uses: ./.github/ccache - with: - workflow_name: ${{ github.workflow }} - job_name: ${{ github.job }} - - - name: Install global meson - run: | - python -m pip install meson --break-system-packages - - - name: Setup Python - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 - with: - python-version: "3.14" - - - name: Setup Python build/test deps - run: | - python -m pip install --group build --group test-core --group openblas32 - python -m pip install build - # Remove `meson` from environment - python -m pip uninstall meson --yes - - - name: Check we're using global Meson - run: | - which meson - - - name: Build wheel and install - run: | - python -m build -wnx - python -m pip install dist/*.whl - - - name: Ccache performance - shell: bash -l {0} - run: | - ccache --evict-older-than 1d - ccache -s - - - name: Run tests - run: | - # Just a small subset of tests; this will be fine if the build - # succeeds (that's the real purpose of this job) - pushd $RUNNER_TEMP - python -m pytest --pyargs scipy.linalg - popd - - ################################################################################# - free-threaded: - name: free-threaded${{ matrix.parallel == '1' && ' (pytest-run-parallel)' || '' }} - needs: get_commit_message - strategy: - matrix: - parallel: ["0", "1"] - fail-fast: false - - runs-on: ubuntu-latest - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - fetch-tags: true - persist-credentials: false - - - uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2 - with: - pixi-version: v0.71.0 - cache: false - - - name: Set up ccache - uses: ./.github/ccache - with: - workflow_name: ${{ github.workflow }} - job_name: ${{ github.job }} - # the two matrix variants build the same thing, avoid saving twice - save: ${{ matrix.parallel == '0' }} - - - name: Run tests (full) - if: ${{ matrix.parallel == '0'}} - run: pixi run test-freethreading -j4 -m full --durations=10 - - - name: Run tests (fast, with pytest-run-parallel) - if: ${{ matrix.parallel == '1'}} - run: pixi run test-parallel-freethreading - - - name: Ccache performance - shell: bash -l {0} - run: | - pixi exec ccache --evict-older-than 1d - pixi exec ccache -s - - ################################################################################# - clang-23-build-only: - # Purpose is to check for warnings in builds with latest clang. - # We do not run the test suite here. - name: Clang-23 aarch build-only (-Werror) - needs: get_commit_message - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - runs-on: ubuntu-24.04-arm - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - persist-credentials: false - - - uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2 - with: - pixi-version: v0.71.0 - cache: false - - - name: Build wheel, check for compiler warnings - run: pixi run build-clang-23 - - ################################################################################# - test_aarch64: - name: aarch64, fast, fail slow, py3.12/npAny, spin - # We want to check for test timing only in a single job, on Linux, running the - # fast test suite. This is that job. See gh-20806 for previous issues - # after running this job on Windows and in multiple jobs. - needs: get_commit_message - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - runs-on: ubuntu-24.04-arm - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - persist-credentials: false - - - uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2 - with: - pixi-version: v0.71.0 - cache: false - - - name: Test SciPy - run: | - pixi run test-fail-slow diff --git a/.github/workflows/linux_blas.yml b/.github/workflows/linux_blas.yml deleted file mode 100644 index e98259ab47d2..000000000000 --- a/.github/workflows/linux_blas.yml +++ /dev/null @@ -1,183 +0,0 @@ -name: BLAS tests (Linux) - -# This file is meant for testing LP64/ILP64 BLAS/LAPACK flavors and build -# options on Linux. All other yml files for Linux will only test LP64 BLAS/LAPACK flavors. -# -# Jobs and their purpose: -# -# - mkl: -# Tests MKL installed from conda-forge in -# 2 ways: both LP64 and ILP64 via pkg-config. -# -# - scipy-openblas64: -# Tests ILP64-enabled build with scipy-openblas64. -# Note that scipy-openblas32 is tested in other workflows. -# - -on: - pull_request: - branches: - - main - - maintenance/** - -defaults: - run: - shell: bash - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -permissions: - contents: read # to fetch code (actions/checkout) - -jobs: - get_commit_message: - name: Get commit message - uses: ./.github/workflows/commit_message.yml - - mkl-lp64: - runs-on: ubuntu-latest - name: "MKL LP64" - needs: get_commit_message - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - fetch-depth: 0 - persist-credentials: false - - - uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2 - with: - pixi-version: v0.71.0 - cache: false - - - name: Build with defaults (LP64) - run: | - pixi run --environment=build-mkl-lp64 pkg-config --libs mkl-dynamic-lp64-seq # check link flags - pixi run build-mkl-lp64 - pixi run check-mkl-lp64-sharedlibs - - - name: Test - run: pixi run --skip-deps test-mkl-lp64 - - mkl-ilp64: - runs-on: ubuntu-latest - name: "MKL ILP64 (cython-blas LP64)" - needs: get_commit_message - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - fetch-depth: 0 - persist-credentials: false - - - uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2 - with: - pixi-version: v0.71.0 - cache: false - - - name: Build with ILP64, cython-blas LP64 - run: | - # Note: the `lp64` in the .pc name isn't a mistake, due to cython-blas-abi=lp64 - pixi run -e build-mkl-ilp64 pkg-config --libs mkl-dynamic-lp64-seq # check link flags - pixi run build-mkl-ilp64 - - - name: Check shared libraries - run: pixi run check-mkl-ilp64-sharedlibs - - - name: Test - run: pixi run --skip-deps test-mkl-ilp64 - - mkl-cyilp64: - runs-on: ubuntu-latest - name: "MKL ILP64 (cython-blas ILP64)" - needs: get_commit_message - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - fetch-depth: 0 - persist-credentials: false - - - uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2 - with: - pixi-version: v0.71.0 - cache: false - - - name: Build with ILP64, cython-blas ILP64 - run: | - pixi run -e build-mkl-ilp64 pkg-config --libs mkl-dynamic-ilp64-seq # check link flags - pixi run build-mkl-cyilp64 - - - name: Check shared libraries - run: pixi run check-mkl-cyilp64-sharedlibs - - - name: Test - run: pixi run --skip-deps test-mkl-cyilp64 - - - name: Install linalg ILP64 downstream test package - # `spin run` needs build deps available - shell: pixi run -e build-mkl-cyilp64 spin run --build-dir=build-mkl-cyilp64 bash -e {0} - run: | - pixi global install uv - # `spin run` sets the system Python, so pass `--system` - uv pip install --system --no-build-isolation -v -Csetup-args=--werror scipy/linalg/tests/_cython_examples/ilp64_test_package - - - name: Test linalg ILP64 downstream test package - # `spin run` needs build deps available - shell: pixi run -e build-mkl-cyilp64 spin run --build-dir=build-mkl-cyilp64 bash -e {0} - run: | - cp -r scipy/linalg/tests/_cython_examples/ilp64_test_package/tests /tmp/ilp64_tests - cd /tmp - uv pip install --system pytest - python -m pytest ilp64_tests - - scipy-openblas-ilp64: - runs-on: ubuntu-latest - name: "scipy-openblas ILP64" - needs: get_commit_message - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - fetch-depth: 0 - persist-credentials: false - - - uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2 - with: - pixi-version: v0.71.0 - cache: false - - - name: Build with ILP64 - run: pixi run build-scipy-openblas64 - - - name: Test - run: pixi run --skip-deps test-scipy-openblas64 - - - name: Install linalg ILP64 downstream test package - # `spin run` needs build deps available - shell: pixi run -e scipy-openblas64 spin run --build-dir=build-scipy-openblas64 bash -e {0} - run: | - pixi global install uv - # `spin run` sets the system Python, so pass `--system` - uv pip install --system --no-build-isolation -v -Csetup-args=--werror scipy/linalg/tests/_cython_examples/ilp64_test_package - - - name: Test linalg ILP64 downstream test package - shell: pixi run -e scipy-openblas64 spin run --build-dir=build-scipy-openblas64 bash -e {0} - run: | - cp -r scipy/linalg/tests/_cython_examples/ilp64_test_package/tests /tmp/ilp64_tests - cd /tmp - pytest ilp64_tests diff --git a/.github/workflows/linux_intel_oneAPI.yml b/.github/workflows/linux_intel_oneAPI.yml deleted file mode 100644 index 91477d84bf2e..000000000000 --- a/.github/workflows/linux_intel_oneAPI.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: Intel oneAPI tests - -on: - push: - branches: - - maintenance/** - pull_request: - branches: - - main - - maintenance/** - schedule: - # ┌───────────── minute (0 - 59) - # │ ┌───────────── hour (0 - 23) - # │ │ ┌───────────── day of the month (1 - 31) - # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) - # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) - # │ │ │ │ │ - - cron: "9 9 2/2 * *" - -permissions: - contents: read # to fetch code (actions/checkout) - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - get_commit_message: - name: Get commit message - uses: ./.github/workflows/commit_message.yml - - icx_icpx_ifx_mkl: - name: test - needs: get_commit_message - # Ensure (a) this doesn't run on forks by default, and - # (b) it does run with Act locally (`github` doesn't exist there) - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - runs-on: ubuntu-24.04 - - steps: - - name: Checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - persist-credentials: false - - # Reference https://github.com/easimon/maximize-build-space/blob/master/action.yml - # see https://github.com/scipy/scipy/issues/23813 - - name: Free up disk space - run: | - df -h - sudo rm -rf /usr/local/lib/android - df -h - - - uses: prefix-dev/setup-pixi@a0af7a228712d6121d37aba47adf55c1332c9c2e # v0.9.4 - with: - pixi-version: v0.77.1 - cache: false - environments: >- - build-intel - test-intel - activate-environment: build-intel - - - name: cache install - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - with: - path: /opt/intel/oneapi/ - key: install-${{ env.LINUX_CPPKIT_URL }}-${{ env.LINUX_HPCKIT_URL }}-compiler - - - name: Initialise Intel oneAPI and Build SciPy - shell: bash -l {0} - run: pixi run build-intel - - - name: Test scipy - shell: bash -l {0} - run: pixi run --environment=test-intel --skip-deps test-intel diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml deleted file mode 100644 index b1bebf6005e2..000000000000 --- a/.github/workflows/macos.yml +++ /dev/null @@ -1,161 +0,0 @@ -name: macOS tests - -on: - push: - branches: - - maintenance/** - pull_request: - branches: - - main - - maintenance/** - -permissions: - contents: read # to fetch code (actions/checkout) - -env: - INSTALLDIR: "build-install" - CCACHE_MAXSIZE: "250M" - CCACHE_DIR: "${{ github.workspace }}/.ccache" - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - get_commit_message: - name: Get commit message - uses: ./.github/workflows/commit_message.yml - - test_meson: - name: Conda & umfpack/scikit-sparse, fast, py3.12/npAny, spin - needs: get_commit_message - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - runs-on: macos-latest - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - persist-credentials: false - - - uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2 - with: - pixi-version: v0.71.0 - cache: false - environments: py312-system-libs-osx - - - name: Set up ccache - uses: ./.github/ccache - with: - job_name: ${{ github.job }} - workflow_name: ${{ github.workflow }} - - - name: Test SciPy - shell: bash -l {0} - run: | - rm -rf ../../subprojects/boost_math # so will fail if system boost doesn't work - rm -rf ../../subprojects/qhull_r # so will fail if system qhull doesn't work - export OMP_NUM_THREADS=2 - pixi run test-system-libs -j2 - - - name: Ccache statistics - shell: bash -l {0} - run: pixi exec ccache -s - - - test_accelerate: - name: Accelerate, full, py3.14/npAny, spin - needs: get_commit_message - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - runs-on: macos-15 - strategy: - matrix: - environment: [accelerate-lp64, accelerate-ilp64] - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - persist-credentials: false - - - uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2 - with: - pixi-version: v0.71.0 - cache: false - environments: ${{ matrix.environment }} - - - name: Test SciPy - # mpmath tests are too slow for CI - run: pixi run test-${ENVIRONMENT} -m full -- -k "not mpmath" - env: - ENVIRONMENT: ${{ matrix.environment }} - - clang_ASAN: - name: Test under AddressSanitizer - runs-on: macos-15 - needs: get_commit_message - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - fetch-tags: true - persist-credentials: false - - - name: Set up pyenv - run: | - git clone https://github.com/pyenv/pyenv.git "$HOME/.pyenv" - PYENV_ROOT="$HOME/.pyenv" - PYENV_BIN="$PYENV_ROOT/bin" - PYENV_SHIMS="$PYENV_ROOT/shims" - echo "$PYENV_BIN" >> $GITHUB_PATH - echo "$PYENV_SHIMS" >> $GITHUB_PATH - echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV - - - name: Set up LLVM - run: | - brew install llvm@19 - LLVM_PREFIX=$(brew --prefix llvm@19) - # shellcheck disable=SC2129 - echo CC="$LLVM_PREFIX/bin/clang" >> $GITHUB_ENV - echo CXX="$LLVM_PREFIX/bin/clang++" >> $GITHUB_ENV - echo LDFLAGS="-L$LLVM_PREFIX/lib" >> $GITHUB_ENV - echo CPPFLAGS="-I$LLVM_PREFIX/include" >> $GITHUB_ENV - - - name: Build Python with AddressSanitizer - run: | - CONFIGURE_OPTS="--with-address-sanitizer" pyenv install 3.14t - pyenv global 3.14t - - - name: Install NumPy dependencies from PyPI - run: | - pip install meson-python ninja cython - - - name: Build NumPy with ASan - run: - pip install numpy --no-binary numpy --no-build-isolation -Csetup-args="-Db_sanitize=address" -v - - - name: Install SciPy dependencies from PyPI - run: | - pip install --group build --group dev-cli --group test-core - - - name: Build SciPy with ASan - run: | - # TODO - # - add --asan to spin build command - # - removmove -fsanitize=address from C{XX}FLAGS - CFLAGS="-fsanitize=address -fno-omit-frame-pointer -fsanitize-ignorelist=$(pwd)/tools/asan-ignore.txt -Wno-deprecated-declarations" - export CFLAGS - CXXFLAGS="-fsanitize=address -fno-omit-frame-pointer -fsanitize-ignorelist=$(pwd)/tools/asan-ignore.txt -Wno-deprecated-declarations" - export CXXFLAGS - spin build -S-Dblas=accelerate - - - name: Test - run: | - # pass -s to pytest to see ASAN errors and warnings, otherwise pytest captures them - ASAN_OPTIONS=detect_leaks=0:symbolize=1:strict_init_order=true:allocator_may_return_null=1:use_sigaltstack=0 \ - spin test -- -v -s --timeout=600 --durations=10 -m 'not fail_asan' diff --git a/.github/workflows/pixi-packages.yml b/.github/workflows/pixi-packages.yml deleted file mode 100644 index 629240084e28..000000000000 --- a/.github/workflows/pixi-packages.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Pixi Packages - -on: - push: - branches: - - main - - maintenance/** - pull_request: - branches: - - main - - maintenance/** - -permissions: - contents: read # to fetch code (actions/checkout) - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - get_commit_message: - name: Get commit message - uses: ./.github/workflows/commit_message.yml - - build_packages: - name: Build - needs: get_commit_message - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - runs-on: ${{ matrix.runs-on }} - strategy: - fail-fast: false - matrix: - runs-on: [ubuntu-latest, windows-2025] # macOS jobs have less concurrency - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - persist-credentials: false - - - uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2 - with: - pixi-version: v0.71.0 - run-install: false - - - name: Build - run: pixi publish diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml deleted file mode 100644 index f5fda7f342bf..000000000000 --- a/.github/workflows/wheels.yml +++ /dev/null @@ -1,147 +0,0 @@ -# Workflow to build and test wheels. -# To work on the wheel building infrastructure on a fork, comment out: -# -# if: github.repository == 'scipy/scipy' -# -# All files related to wheel building are located -# at tools/wheels/ - -# The aim is to keep the workflow as close as possible to that of -# scipy/scipy-release. -name: Wheel builder - - -env: - UV_VERSION: "0.12.5" - - -on: - push: - branches: - - maintenance/** - pull_request: - branches: - - main - - maintenance/** - workflow_dispatch: - -permissions: - contents: read # to fetch code (actions/checkout) - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - get_commit_message: - name: Get commit message - uses: ./.github/workflows/commit_message.yml - - - build_wheels: - name: BLD > ${{ matrix.python }}-${{ matrix.buildplat[1] }}-${{ matrix.buildplat[2] }}-${{ matrix.buildplat[3] }} - needs: get_commit_message - runs-on: ${{ matrix.buildplat[0] }} - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - strategy: - # Ensure that a wheel builder finishes even if another fails - fail-fast: false - matrix: - # Github Actions doesn't support pairing matrix values together, let's improvise - # https://github.com/github/feedback/discussions/7835#discussioncomment-1769026 - buildplat: - # should also be able to do multi-archs on a single entry, e.g. - # [windows-2025, win*, "AMD64 x86"]. However, those two require a different compiler setup - # so easier to separate out here. - - [ubuntu-24.04, manylinux, x86_64, "", ""] - - [ubuntu-24.04, musllinux, x86_64, "", ""] - - [ubuntu-24.04-arm, manylinux, aarch64, "", ""] - - [ubuntu-24.04-arm, musllinux, aarch64, "", ""] - - [macos-15-intel, macosx, x86_64, openblas, "10.15"] - - [macos-15-intel, macosx, x86_64, accelerate, "14.0"] - - [macos-14, macosx, arm64, openblas, "12.3"] - - [macos-14, macosx, arm64, accelerate, "14.0"] - - [windows-2025, win, AMD64, "", ""] - - [windows-11-arm, win, ARM64, "", ""] - python: ["cp312"] - - steps: - - name: Checkout scipy - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: true - persist-credentials: false - - # the version of python we'll run cibuildwheel with - - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 - with: - python-version: 3.13 - - # Used in cibw_before_build to install pinned build dependencies - # Note that cibuildwheel provides it in the Linux images, so this install - # is only useful on macOS/windows - - name: Install uv - uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0 - with: - # can't use checksum here, because there are different packages - # for different OS - version: ${{ env.UV_VERSION }} - enable-cache: false - - # create a lock file, to keep the workflow as close as possible to scipy-release - - name: Create uv.lock - run: | - uv lock --exclude-newer "7 days" - - - name: Setup windows - if: matrix.buildplat[1] == 'win' - shell: pwsh - run: | - echo "CC=clang-cl" >> $env:GITHUB_ENV - echo "CXX=clang-cl" >> $env:GITHUB_ENV - echo "TARGET_ARCH=${{ matrix.buildplat[2] }}" >> $env:GITHUB_ENV - - # workaround for https://github.com/scipy/scipy/issues/25067 - rm -fo c:/Strawberry/c/lib/pkgconfig/*.pc - - # pkg-config setup - $CIBW = "${{ github.workspace }}/.openblas" - # pkgconfig needs a complete path, and not just "./openblas since the - # build is run in a tmp dir (?) - # It seems somewhere in the env passing, `\` is not - # passed through, so convert it to '/' - $CIBW = $CIBW.replace("\","/") - echo "CIBW_ENVIRONMENT_WINDOWS=PKG_CONFIG_PATH=$CIBW" >> $env:GITHUB_ENV - - - name: Setup macOS - if: startsWith( matrix.buildplat[0], 'macos-' ) - env: - BLAS_VARIANT: ${{ matrix.buildplat[3] }} - MACOSX_DEPLOYMENT_TARGET: ${{ matrix.buildplat[4] }} - run: | - if [[ "${BLAS_VARIANT}" == "accelerate" ]]; then - echo "CIBW_CONFIG_SETTINGS=setup-args=-Dblas=accelerate setup-args=-Dconfig-output=portable" >> "$GITHUB_ENV" - - # Builds with Accelerate only target macOS>=14.0 - CIBW_ENV="CIBW_ENVIRONMENT_MACOS=MACOSX_DEPLOYMENT_TARGET=14.0 INSTALL_OPENBLAS=false" - else - CIBW_ENV="CIBW_ENVIRONMENT_MACOS=PKG_CONFIG_PATH=$PWD/.openblas MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET}" - fi - echo "$CIBW_ENV" >> "$GITHUB_ENV" - - - name: Build wheels - uses: pypa/cibuildwheel@e090b81e30c4d855ea63bf4b6e59204c09a101ae # v4.2.1 - env: - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}* - CIBW_ARCHS: ${{ matrix.buildplat[2] }} - CIBW_ENABLE: cpython-prerelease - with: - config-file: pyproject.toml - output-dir: dist - - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - path: ./dist/*.whl - name: ${{ matrix.python }}-${{ matrix.buildplat[1] }}-${{ matrix.buildplat[2] }}-${{ matrix.buildplat[3] }}-${{ matrix.buildplat[4] }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml deleted file mode 100644 index 17eb558660a2..000000000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,136 +0,0 @@ -name: Windows tests - -on: - push: - branches: - - maintenance/** - pull_request: - branches: - - main - - maintenance/** - -permissions: - contents: read # to fetch code (actions/checkout) - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - get_commit_message: - name: Get commit message - uses: ./.github/workflows/commit_message.yml - - fast_spin: - name: fast, py3.12/npAny, spin - needs: get_commit_message - # Ensure (a) this doesn't run on forks by default, and - # (b) it does run with Act locally (`github` doesn't exist there) - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - runs-on: windows-2025 - steps: - - name: Checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - persist-credentials: false - - - uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2 - with: - pixi-version: v0.71.0 - cache: false - environments: >- - build - test - - - name: Build - run: pixi run build - - - name: Test - run: | - # test runner parallel clashes with OpenBLAS multithreading - $env:OPENBLAS_NUM_THREADS=1 - pixi run test -j4 -- --durations=25 - - ############################################################################# - full_spin_min_numpy: - name: full, py3.12/npMin, spin - needs: get_commit_message - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - runs-on: windows-2025 - steps: - - name: Checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 - with: - python-version: "3.12" - - - name: Set rtools location (mingw-w64) - run: | - echo "c:\rtools45\ucrt64\bin" >> $env:GITHUB_PATH - - - name: pip-packages - run: | - # 2.0.0 is currently our oldest supported NumPy version - python -m pip install numpy==2.0.0 --group build --group dev-cli --group test-core --group openblas32 - - - name: Build - run: | - $env:FORCE_PKGCONF_PYPI=1 - spin build --with-scipy-openblas=32 - - - name: Test - run: | - # test runner parallel clashes with OpenBLAS multithreading - $env:OPENBLAS_NUM_THREADS=1 - # Avoid occasional anomalous long durations of a test in interpolate; - # see gh-25142. - $env:WINDOWS_CI_LONG_TIMEOUT=600 - spin test -j4 --mode full -- --durations=25 --timeout=60 - - ############################################################################# - fast_spin_arm64: - name: fast, py3.12/npAny, spin (Win-ARM64), no pythran - runs-on: windows-11-arm - needs: get_commit_message - if: > - needs.get_commit_message.outputs.message == 1 && - (github.repository == 'scipy/scipy' || github.repository == '') - steps: - - name: Checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 - with: - python-version: "3.12" - architecture: "arm64" - - - name: pip-packages - run: | - # `numpy<2.4.3` pin is due to np.linalg.solve crash, see gh-24774 - python -m pip install "numpy<2.4.3" --group build --group dev-cli --group test-core --group openblas32 - - - name: Build - run: | - $env:Path = "C:\Program Files\LLVM\bin;" + $env:Path - $env:cc = "clang-cl" - $env:cxx = "clang-cl" - spin build --with-scipy-openblas=32 --setup-args="-Duse-pythran=false" - - - name: Test - run: | - $env:OPENBLAS_NUM_THREADS = 1 - spin test -j2 -- --durations=25 diff --git a/.github/workflows/windows_intel_oneAPI.yml b/.github/workflows/windows_intel_oneAPI.yml deleted file mode 100644 index c9c9ac1450d3..000000000000 --- a/.github/workflows/windows_intel_oneAPI.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: Windows tests (MSVC + ifx + OpenBLAS) -# TODO: replace OpenBLAS with MKL. This is harder to get to build, so we merged with OpenBLAS first. - -on: - push: - branches: - - maintenance/** - pull_request: - branches: - - main - - maintenance/** - schedule: - # ┌───────────── minute (0 - 59) - # │ ┌───────────── hour (0 - 23) - # │ │ ┌───────────── day of the month (1 - 31) - # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) - # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) - # │ │ │ │ │ - - cron: "9 9 2/2 * *" - -permissions: - contents: read # to fetch code (actions/checkout) - -# The environment variable WINDOWS_HPC_URL -# store the URL for downloading Intel oneAPI. -# Reference - https://github.com/oneapi-src/oneapi-ci/blob/b4a96bd1888c130fcb73524d2b77b90f43681cbc/.github/workflows/build_all.yml#L11-L12 -env: - WINDOWS_HPC_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/a37c30c3-a846-4371-a85d-603e9a9eb94c/intel-oneapi-hpc-toolkit-2025.0.1.48_offline.exe - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - get_commit_message: - name: Get commit message - uses: ./.github/workflows/commit_message.yml - - msvc_ifx_blas: - name: py3.12, spin - needs: get_commit_message - # Ensure (a) this doesn't run on forks by default, and - # (b) it does run with Act locally (`github` doesn't exist there) - if: > - needs.get_commit_message.outputs.message == 1 - && (github.repository == 'scipy/scipy' || github.repository == '') - runs-on: windows-2022 - defaults: - run: - shell: powershell - steps: - - name: Checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - persist-credentials: false - - - name: cache install - id: cache-install - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - with: - path: | - C:\Program Files (x86)\Intel\oneAPI\compiler - C:\Program Files (x86)\Intel\oneAPI\setvars.bat - C:\Program Files (x86)\Intel\oneAPI\setvars-vcvarsall.bat - key: install-${{ env.WINDOWS_HPC_URL }}-compiler - - name: Install oneAPI HPC kit - if: steps.cache-install.outputs.cache-hit != 'true' - shell: cmd /C call {0} # need to use `cmd` for batch scripts - run: | - echo %WINDOWS_HPC_URL% - tools\intel_oneAPI\install_intel_oneAPI_windows.bat "%WINDOWS_HPC_URL%" "" "dfbf8487f6ee5b9c1bb2cad19f2ef8dd842529a533670ce21582d39c303bf979" &REM 2025.0.1.48 - - - name: Setup Conda - uses: conda-incubator/setup-miniconda@be893c923ea9cf1cf7cd510fbdde27c7e18cbdcb # v4.1.0 - with: - python-version: 3.12 - channels: conda-forge - channel-priority: strict - use-only-tar-bz2: false - miniforge-variant: Miniforge3 - miniforge-version: latest - auto-activate-base: true - activate-environment: true - - - run: conda --version - - run: which python - - - name: Install packages from conda - shell: pwsh - run: conda install -c conda-forge pkg-config meson meson-python ninja openblas libblas=*=*openblas numpy==2.0 cython pybind11 pytest pytest-xdist pytest-timeout pooch spin hypothesis "click<8.3.0" - - # MSVC is unable to compile Pythran code, therefore we need to use - # -C-Duse-pythran=false while building SciPy. - # Reference - https://github.com/serge-sans-paille/pythran/issues/2215 - - name: Initialise Intel oneAPI, MSVC and Build SciPy - shell: cmd /C call {0} # need to use `cmd` for batch scripts - run: | - call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - spin build -S-Duse-pythran=false -S--vsenv - - - name: Test scipy.datasets - shell: pwsh - run: spin test -s datasets diff --git a/pyproject.toml b/pyproject.toml index d666134c8d6a..12fe8816e527 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -278,8 +278,8 @@ build-frontend = { name = "pyodide-build" } before-build = "bash {project}/tools/wheels/cibw_before_build_pyodide.sh {project}" before-test = "" repair-wheel-command = "pyodide auditwheel repair --libdir {project}/.blis/lib --output-dir {dest_dir} {wheel}" -test-requires = ["pytest", "pytest-split", "hypothesis", "threadpoolctl", "pooch"] -test-command = "bash {project}/tools/wheels/cibw_test_command_pyodide.sh" +test-requires = ["pytest", "hypothesis", "threadpoolctl", "pooch"] +test-command = "python -m pytest -vra --pyargs scipy -m 'not slow'" [tool.cibuildwheel.pyodide.config-settings] setup-args = ["-Dblas=blis", "-Dlapack=semicolon-lapack", "-Dconfig-output=portable"] build-dir = "build/pyodide" diff --git a/scipy/linalg/tests/test_lapack.py b/scipy/linalg/tests/test_lapack.py index 522aa3f890f4..bc1fe4b206f5 100644 --- a/scipy/linalg/tests/test_lapack.py +++ b/scipy/linalg/tests/test_lapack.py @@ -26,7 +26,6 @@ from scipy.linalg.lapack import _compute_lwork from scipy.stats import ortho_group, unitary_group from scipy.sparse import diags_array -from scipy._lib._testutils import IS_WASM from scipy.linalg.lapack import get_lapack_funcs from scipy.linalg.blas import get_blas_funcs @@ -36,7 +35,6 @@ DTYPES = REAL_DTYPES + COMPLEX_DTYPES -@pytest.mark.skipif(IS_WASM, reason="re-loading extension modules hangs in WASM") @pytest.mark.parametrize('module_name, routine', [ ('_fblas', 'daxpy'), ('_fblas_64', 'daxpy'), diff --git a/tools/wheels/cibw_before_build_pyodide.sh b/tools/wheels/cibw_before_build_pyodide.sh index 32955fae36e0..64c2a3fe7dfa 100755 --- a/tools/wheels/cibw_before_build_pyodide.sh +++ b/tools/wheels/cibw_before_build_pyodide.sh @@ -30,9 +30,12 @@ python -m pip install "meson>=1.5.0" "ninja>=1.8.2" BLIS_REPO="https://github.com/pyodide/blis" BLIS_REF="pyodide-2.1" -# semicolon-lapack -SEMILAPACK_VERSION="0.01.3-pre" -SEMILAPACK_URL="https://github.com/ilayn/semicolon-lapack/archive/refs/tags/v${SEMILAPACK_VERSION}.tar.gz" +# semicolon-lapack, from the branch behind ilayn/semicolon-lapack#36 until that +# is merged and released. It stops the Fortran-ABI shim from writing IFAIL when +# JOBZ = 'N', which overran the buffers SciPy passes and caused the hangs and +# traps in this job (gh-25713). +SEMILAPACK_REPO="https://github.com/agriyakhetarpal/semicolon-lapack" +SEMILAPACK_REF="fix-fabi-shim-ifail-jobz" # To be consumed via PKG_CONFIG_PATH BLAS_PREFIX="${PROJECT_DIR}/.blis" @@ -82,9 +85,7 @@ popd # 2. semicolon-lapack # --------------------------------------------------------------------------- -curl -L "${SEMILAPACK_URL}" -o "${BUILD_ROOT}/semilapack.tar.gz" -mkdir -p "${BUILD_ROOT}/semilapack" -tar -xzf "${BUILD_ROOT}/semilapack.tar.gz" -C "${BUILD_ROOT}/semilapack" --strip-components=1 +git clone --depth 1 --branch "${SEMILAPACK_REF}" "${SEMILAPACK_REPO}" "${BUILD_ROOT}/semilapack" pushd "${BUILD_ROOT}/semilapack" CC=emcc CXX=em++ AR=emar \ meson setup builddir \ diff --git a/tools/wheels/cibw_test_command_pyodide.sh b/tools/wheels/cibw_test_command_pyodide.sh deleted file mode 100755 index d6f9dae93720..000000000000 --- a/tools/wheels/cibw_test_command_pyodide.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# Run the SciPy test suite for the WebAssembly/Pyodide build in splits, to -# avoid memory corruption issues noticed when not doing so, see gh-25713 - -ret=0 - -# number of pytest-split groups to run -N=10 - -# iteration number of the current group -i=1 - -while [ "$i" -le "$N" ]; do - echo "::group::SciPy test group $i of $N" - python -m pytest -vra --pyargs scipy -m 'not slow' --splits "$N" --group "$i" - rc=$? - echo "::endgroup::" - if [ "$rc" -ne 0 ] && [ "$rc" -ne 5 ]; then ret=1; echo "!! pytest-split group $i failed (exit $rc)"; fi - i=$((i + 1)) -done - -exit $ret