Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: 1.9.2 backports #17132

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
12327ba
FIX: Updated dtype resolution in `_stack_along_minor_axis` (#16628)
Micky774 Sep 27, 2022
0204a3d
ENH: cibuildwheel infrastructure (#16842)
andyfaff Aug 23, 2022
461b992
MAINT: minimize, restore squeezed ((1.0))
andyfaff Aug 26, 2022
705ee88
Cast linear_sum_assignment to PyCFunction
hoodmane Aug 30, 2022
da01ada
BLD: use compiler flags in a more portable way.
rgommers Aug 31, 2022
670782a
MAINT: stats.mode: fix bug with `axis!=1`, `nan_policy='omit'`, `keep…
mdhaber Sep 15, 2022
0df827a
BLD: fix usage of `get_install_data`, which defaults to purelib
rgommers Sep 6, 2022
08cc962
DOC: Update numpy supported versions for 1.9.2
lesteve Sep 7, 2022
74d8dfe
BUG: missed one more gcc-specific flag, clean it up
rgommers Sep 4, 2022
b18c9be
BLD: compensate for funky ifort name mangling on Windows
rgommers Sep 4, 2022
6ee0091
BLD: use native threads on Windows, not pthreads
rgommers Sep 4, 2022
0fd485e
TST: cibuildwheel test manylinux_aarch64
andyfaff Sep 12, 2022
caa9915
BLD: make MKL detection more robust, add notes on TODOs
rgommers Sep 12, 2022
466cb94
DOC: fix a formatting issue in the building FAQ doc page
rgommers Sep 12, 2022
9447b60
CI: Update cibuildwheel to 2.10.1
EwoutH Sep 19, 2022
7c97930
BUG: Fix numerical precision error of truncnorm.logcdf
not522 Sep 21, 2022
b04b7eb
MAINT: stats.truncnorm.logcdf/logsf: fix another catastropic cancella…
mdhaber Sep 23, 2022
e079338
FIX: ensure a hold on GIL before raising warnings/errors (#17096)
mckib2 Sep 27, 2022
58c8b79
TST: stats.studentized_range: fix incorrect test
mdhaber Oct 1, 2022
7b76dba
MAINT: pyproject.toml: Update build system requirements
EwoutH Oct 2, 2022
9c923e6
DOC: update 1.9.2 relnotes.
tylerjereddy Oct 2, 2022
f3ca38d
MAINT: PR 17132 revisions
tylerjereddy Oct 4, 2022
d885c55
BLD: remove Meson pin, newer versions have fixes we need
rgommers Oct 4, 2022
dc1ae86
BLD: add `_USE_MATH_DEFINES` for all Cython-generated code
rgommers Aug 8, 2022
35138da
BUG: sparse: Avoid creating a view when ensuring that an array has na…
WarrenWeckesser Sep 16, 2022
54e27b3
TST: mark float32 gges and qz tests as knownfail
rgommers Oct 4, 2022
50c85e6
TST: mark one `linalg.solve_discrete_are` as knownfail
rgommers Sep 20, 2022
5a793e9
DOC: replace `set_tight_layout` with `set_layout_engine` in example
rgommers Oct 4, 2022
014ecf6
CI: update wheel builder triggers
rgommers Oct 4, 2022
2bc973a
BLD: set version to 1.9.2.dev0 (and trigger wheel build CI)
rgommers Oct 4, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
220 changes: 220 additions & 0 deletions .github/workflows/wheels.yml
@@ -0,0 +1,220 @@
# Workflow to build and test wheels.
# To work on the wheel building infrastructure on a fork, comment out:
#
# if: github.repository == 'scipy/scipy'
#
# in the get_commit_message job include [wheel build] in your commit
# message to trigger the build. All files related to wheel building are located
# at tools/wheels/
name: Wheel builder

on:
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 * * 6"
# push:
pull_request:
branches:
- main
- maintenance/**
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
get_commit_message:
name: Get commit message
runs-on: ubuntu-latest
if: github.repository == 'scipy/scipy'
outputs:
message: ${{ steps.commit_message.outputs.message }}
steps:
- name: Checkout scipy
uses: actions/checkout@v3
# Gets the correct commit message for pull request
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Get commit message
id: commit_message
run: |
set -xe
COMMIT_MSG=$(git log --no-merges -1)
RUN="0"
if [[ "$COMMIT_MSG" == *"[wheel build]"* ]]; then
RUN="1"
fi
echo "::set-output name=message::$RUN"
echo github.ref ${{ github.ref }}

build_wheels:
name: Build wheel for ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }} ${{ matrix.buildplat[2] }}
needs: get_commit_message
if: >-
contains(needs.get_commit_message.outputs.message, '1') ||
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0')))
runs-on: ${{ matrix.buildplat[0] }}

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-2019, win*, "AMD64 x86"]. However, those two require a different compiler setup
# so easier to separate out here.
- [ubuntu-20.04, manylinux, x86_64]
- [ubuntu-20.04, manylinux, aarch64]

# When the macos-10.15 image is retired the gfortran/openblas chain
# may have to be reworked because the gfortran-4.9.0 compiler currently
# used in CI doesn't work in the macos-11.0 image. This will require a more
# recent gfortran (gfortran-9 is present on the macOS-11.0 image), and
# will probably require that the prebuilt openBLAS is updated.
# xref https://github.com/andyfaff/scipy/pull/28#issuecomment-1203496836
- [macos-10.15, macosx, x86_64]
- [macos-12, macosx, arm64]
- [windows-2019, win, AMD64]

python: [["cp38", "3.8"], ["cp39", "3.9"], ["cp310", "3.10"], ["cp311", "3.11.0-alpha - 3.11.0"]]
# python[0] is used to specify the python versions made by cibuildwheel
# python[1] is installed by actions/setup-python for the separate
# macosx_arm64 build. Once cibuildwheel can do the macosx_arm64 cross build
# we can get rid of this duplication and just have ["cp38", "cp39"].
# The actions/setup-python can only use the form ["3.8'].
env:
IS_32_BIT: ${{ matrix.buildplat[2] == 'x86' }}
IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}

steps:
- name: Checkout scipy
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0

- uses: actions/setup-python@v4.2.0
with:
python-version: ${{ matrix.python[1]}}

- name: win_amd64 - install rtools
run: |
# mingw-w64
choco install rtools --no-progress
echo "c:\rtools40\ucrt64\bin;" >> $env:GITHUB_PATH
if: ${{ runner.os == 'Windows' && env.IS_32_BIT == 'false' }}

# - name: win32 - configure mingw for 32-bit builds
# run: |
# # taken from numpy wheels.yml script
# # Force 32-bit mingw. v 8.1.0 is the current version used to build
# # the 32 bit openBLAS library (not sure if that matters)
# choco uninstall mingw
# choco install -y mingw --forcex86 --force --version=8.1.0
# echo "C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw32\bin;" >> $env:GITHUB_PATH
# echo $(gfortran --version)
# echo $(gcc --version)
# if: ${{ runner.os == 'Windows' && env.IS_32_BIT == 'true' }}

- name: Set up QEMU
if: ${{ runner.os == 'Linux' && matrix.buildplat[2] == 'aarch64' }}
uses: docker/setup-qemu-action@v1
with:
platforms: all

- name: Build wheels
uses: pypa/cibuildwheel@v2.10.1
# Build all wheels here, but the macosx_arm64 job in its own entry.
# cibuildwheel is currently unable to pass configuration flags to
# CIBW_BUILD_FRONTEND https://github.com/pypa/cibuildwheel/issues/1227
# (pip/build). Cross compilation with meson requires an initial
# configuration step to create a build directory. The subsequent wheel
# build then needs to use that directory. This can be done with pip
# using a command like:
# python -m pip wheel --config-settings builddir=build .
if: >-
( ! contains(matrix.buildplat[2], 'arm64' ) )
env:
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}*
CIBW_ARCHS: ${{ matrix.buildplat[2] }}
CIBW_ENVIRONMENT_PASS_LINUX: RUNNER_OS

- name: Build macosx_arm64
if: ${{ matrix.buildplat[1] == 'macosx' && matrix.buildplat[2] == 'arm64' }}
run: |
export PLAT="arm64"
export _PYTHON_HOST_PLATFORM="macosx-12.0-arm64"
export CROSS_COMPILE=1

# Need macOS >= 11 for arm compilation.
export MACOSX_DEPLOYMENT_TARGET=11.0

# SDK root needs to be set early, installation of gfortran/openblas
# needs to go in the correct location.
export SDKROOT=/Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk
export ARCHFLAGS=" -arch arm64 "

# install dependencies for the build machine
pip install meson cython pybind11 pythran ninja oldest-supported-numpy build delocate meson-python

# sets up gfortran compiler/openblas, sets compiler flags.
bash tools/wheels/cibw_before_build_macos.sh $(pwd)
export PKG_CONFIG_PATH=/opt/arm64-builds/lib/pkgconfig
export PKG_CONFIG=/usr/local/bin/pkg-config
export CFLAGS=" -arch arm64 $CFLAGS"
export CXXFLAGS=" -arch arm64 $CXXFLAGS"
export LD_LIBRARY_PATH="/opt/arm64-builds/lib:$FC_LIBDIR:$LD_LIBRARY_PATH"
meson setup --cross-file $(pwd)/tools/wheels/cross_arm64.txt build

# use the pip frontend because the build front end does not end up
# obeying the configuration flags it's passed.
# For example: `python -m build -Cbuilddir=dir` does not end up using
# dir as the meson build directory. This is an issue because
# the cross-compile specification is contained in that directory.

python -m pip wheel -w dist -vvv --config-settings builddir=build .
rm dist/numpy*.whl

# The `.so` are all converted to `-rpath/libgfortran` by
# gfortran/meson, with all absolute paths removed.
# Enables delocate to find the libopenblas/libgfortran libraries.
export DYLD_LIBRARY_PATH=/opt/gfortran-darwin-arm64/lib/gcc/arm64-apple-darwin20.0.0/10.2.1:/opt/arm64-builds/lib

delocate-listdeps dist/scipy*.whl
delocate-wheel --require-archs=arm64 -k -w wheelhouse dist/scipy*.whl

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
name: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}

# TODO uncomment when those responsible for uploading
# nightly/release wheels want to make this script live.

# - name: Upload wheels
# if: success()
# shell: bash
# env:
# SCIPY_STAGING_UPLOAD_TOKEN: ${{ secrets.SCIPY_STAGING_UPLOAD_TOKEN }}
# SCIPY_NIGHTLY_UPLOAD_TOKEN: ${{ secrets.SCIPY_NIGHTLY_UPLOAD_TOKEN }}
# run: |
# source tools/wheels/upload_wheels.sh
# set_upload_vars
# # trigger an upload to
# # https://anaconda.org/scipy-wheels-nightly/scipy
# # for cron jobs or "Run workflow" (restricted to main branch).
# # Tags will upload to
# # https://anaconda.org/multibuild-wheels-staging/scipy
# # The tokens were originally generated at anaconda.org
# upload_wheels
47 changes: 46 additions & 1 deletion doc/release/1.9.2-notes.rst
Expand Up @@ -5,15 +5,60 @@ SciPy 1.9.2 Release Notes
.. contents::

SciPy 1.9.2 is a bug-fix release with no new features
compared to 1.9.1.
compared to 1.9.1. It also provides wheel for Python 3.11
on several platforms.
tylerjereddy marked this conversation as resolved.
Show resolved Hide resolved

Authors
=======

* Hood Chatham (1)
* Thomas J. Fan (1)
* Ralf Gommers (7)
* Matt Haberland (3)
* Julien Jerphanion (1)
* Loïc Estève (1)
* Nicholas McKibben (1)
* Naoto Mizuno (1)
* Andrew Nelson (3)
* Tyler Reddy (21)
* Pamphile Roy (1)
* Ewout ter Hoeven (2)
* Meekail Zain (1) +

A total of 13 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.

Issues closed for 1.9.2
-----------------------

* `#16569 <https://github.com/scipy/scipy/issues/16569>`__: BUG: \`sparse.hstack\` returns incorrect result when the stack...
* `#16898 <https://github.com/scipy/scipy/issues/16898>`__: BUG: optimize.minimize backwards compatability in scipy 1.9
* `#16935 <https://github.com/scipy/scipy/issues/16935>`__: BUG: using msvc + meson to build scipy --> cl cannot be used...
* `#16952 <https://github.com/scipy/scipy/issues/16952>`__: BUG: error from \`scipy.stats.mode\` with \`NaN\`s, \`axis !=...
* `#16964 <https://github.com/scipy/scipy/issues/16964>`__: BUG: scipy 1.7.3 wheels on PyPI require numpy<1.23 in contradiction...
* `#17026 <https://github.com/scipy/scipy/issues/17026>`__: BUG: ncf_gen::ppf(..) causes segfault
* `#17124 <https://github.com/scipy/scipy/issues/17124>`__: BUG: OSX-64 Test failure test_ppf_against_tables getting NaN

Pull requests for 1.9.2
-----------------------

* `#16628 <https://github.com/scipy/scipy/pull/16628>`__: FIX: Updated dtype resolution in \`_stack_along_minor_axis\`
* `#16842 <https://github.com/scipy/scipy/pull/16842>`__: ENH: cibuildwheel infrastructure
* `#16909 <https://github.com/scipy/scipy/pull/16909>`__: MAINT: minimize, restore squeezed ((1.0)) addresses #16898
* `#16911 <https://github.com/scipy/scipy/pull/16911>`__: REL: prep for SciPy 1.9.2
* `#16922 <https://github.com/scipy/scipy/pull/16922>`__: DOC: update version switcher for 1.9.1 and pin theme to 0.9
* `#16934 <https://github.com/scipy/scipy/pull/16934>`__: MAINT: cast \`linear_sum_assignment\` to PyCFunction
* `#16943 <https://github.com/scipy/scipy/pull/16943>`__: BLD: use compiler flags in a more portable way
* `#16954 <https://github.com/scipy/scipy/pull/16954>`__: MAINT: stats.mode: fix bug with \`axis!=1\`, \`nan_policy='omit'\`,...
* `#16966 <https://github.com/scipy/scipy/pull/16966>`__: MAINT: fix NumPy upper bound
* `#16969 <https://github.com/scipy/scipy/pull/16969>`__: BLD: fix usage of \`get_install_data\`, which defaults to purelib
* `#16975 <https://github.com/scipy/scipy/pull/16975>`__: DOC: Update numpy supported versions for 1.9.2
* `#16991 <https://github.com/scipy/scipy/pull/16991>`__: BLD: fixes for building with MSVC and Intel Fortran
* `#17011 <https://github.com/scipy/scipy/pull/17011>`__: Rudimentary test for manylinux_aarch64 with cibuildwheel
* `#17013 <https://github.com/scipy/scipy/pull/17013>`__: BLD: make MKL detection a little more robust, add notes on TODOs
* `#17046 <https://github.com/scipy/scipy/pull/17046>`__: CI: Update cibuildwheel to 2.10.1
* `#17064 <https://github.com/scipy/scipy/pull/17064>`__: BUG: Fix numerical precision error of \`truncnorm.logcdf\` when...
* `#17096 <https://github.com/scipy/scipy/pull/17096>`__: FIX: ensure a hold on GIL before raising warnings/errors
* `#17127 <https://github.com/scipy/scipy/pull/17127>`__: TST: stats.studentized_range: fix incorrect test
* `#17131 <https://github.com/scipy/scipy/pull/17131>`__: MAINT: pyproject.toml: Update build system requirements
4 changes: 2 additions & 2 deletions doc/source/dev/contributor/building_faq.rst
Expand Up @@ -93,7 +93,7 @@ library is MKL and if so, use the CBLAS API instead of the BLAS API.
If autodetection fails or if the user wants to override this
autodetection mechanism, use the following:

_For ``meson`` based builds (new in 1.9.0):_
*For ``meson`` based builds (new in 1.9.0):*

Use the ``-Duse-g77-abi=true`` build option. E.g.,::

Expand All @@ -106,7 +106,7 @@ example)::
$ meson setup builddir -Duse-g77-abi=true -Dblas=blas -Dlapack=lapack -Dpython.install_env=auto
$ meson install -C builddir

_For ``distutils`` based builds:_
*For ``distutils`` based builds:*

Set the environment variable ``SCIPY_USE_G77_ABI_WRAPPER`` to 0 or 1 to disable
or enable using CBLAS API.
Expand Down
2 changes: 2 additions & 0 deletions doc/source/dev/toolchain.rst
Expand Up @@ -78,6 +78,8 @@ The table shows the NumPy versions suitable for each major Python version.
1.7.0/1 >=3.7, <3.10 >=1.16.5, <1.23.0
1.7.2-x >=3.7, <3.11 >=1.16.5, <1.24.0
1.8 >=3.8, <3.11 >=1.17.3, <1.24.0
1.9.0/1 >=3.8, <3.12 >=1.18.5, <1.25.0
1.9.2 >=3.8, <3.12 >=1.18.5, <1.26.0
================= ======================== =======================

In specific cases, such as a particular architecture, these requirements
Expand Down
32 changes: 27 additions & 5 deletions meson.build
Expand Up @@ -4,17 +4,13 @@ project(
# Note that the git commit hash cannot be added dynamically here (it is added
# in the dynamically generated and installed `scipy/version.py` though - see
# tools/version_utils.py
version: '1.9.2',
version: '1.9.2.dev0',
license: 'BSD-3',
meson_version: '>= 0.62.2',
default_options: [
'buildtype=debugoptimized',
'c_std=c99',
'cpp_std=c++14',
# TODO: the below -Wno flags are all needed to silence warnings in
# f2py-generated code. This should be fixed in f2py itself.
'c_args=-Wno-unused-function -Wno-conversion -Wno-misleading-indentation -Wno-incompatible-pointer-types',
'fortran_args=-Wno-conversion',
'fortran_std=legacy',
'blas=openblas',
'lapack=openblas'
Expand All @@ -23,12 +19,24 @@ project(

cc = meson.get_compiler('c')
cpp = meson.get_compiler('cpp')

# This argument is called -Wno-unused-but-set-variable by GCC, however Clang
# doesn't recognize that.
if cc.has_argument('-Wno-unused-but-set-variable')
add_global_arguments('-Wno-unused-but-set-variable', language : 'c')
endif

# TODO: the below -Wno flags are all needed to silence warnings in
# f2py-generated code. This should be fixed in f2py itself.
_global_c_args = cc.get_supported_arguments(
'-Wno-unused-but-set-variable',
'-Wno-unused-function',
'-Wno-conversion',
'-Wno-misleading-indentation',
'-Wno-incompatible-pointer-types',
)
add_project_arguments(_global_c_args, language : 'c')

# We need -lm for all C code (assuming it uses math functions, which is safe to
# assume for SciPy). For C++ it isn't needed, because libstdc++/libc++ is
# guaranteed to depend on it. For Fortran code, Meson already adds `-lm`.
Expand All @@ -39,6 +47,18 @@ endif

# Adding at project level causes many spurious -lgfortran flags.
add_languages('fortran', native: false)
ff = meson.get_compiler('fortran')
if ff.has_argument('-Wno-conversion')
add_project_arguments('-Wno-conversion', language: 'fortran')
endif

is_windows = host_machine.system() == 'windows'

# Intel Fortran on Windows does things differently, so deal with that
if is_windows and ff.get_id() == 'intel-cl'
_ifort_flags = ff.get_supported_arguments('/MD', '/names:lowercase', '/assume:underscore')
add_project_arguments(_ifort_flags, language: 'fortran')
endif

cython = find_program('cython')
pythran = find_program('pythran')
Expand All @@ -48,6 +68,8 @@ copier = find_program(['cp', 'scipy/_build_utils/copyfiles.py'])

# https://mesonbuild.com/Python-module.html
py_mod = import('python')
# NOTE: with Meson >=0.64.0 we can add `pure: false` here and remove that line
# everywhere else, see https://github.com/mesonbuild/meson/pull/10783.
py3 = py_mod.find_installation()
# SciPy 1.9.0-specific error message, see the same message in
# `scipy/__init__.py` and gh-14986
Expand Down