Do not test NumPy against Python 3.15 Windows AMD64 wheels#9674
Conversation
|
The root cause of this is a change in pytest 9.1 which just came out. And of course NumPy doesn't support 3.15 yet. We build it from source, then have this in numpy = pytest.importorskip("numpy", reason="NumPy not installed")With pytest 9.0, we try and import it, it fails due to pytest 9.0 also had a deprecation warning we didn't spot, saying they were going to change the default from skipping for And this default changed to Details at: We could tell Or we could narrow the select to only exclude the failing Windows AMD64? So all the others (at least Linux, macOS) continue to test NumPy. We'll need to remember to remove it later. With 9.0: ============================== warnings summary ===============================
Tests\test_image_array.py:12
C:\pillow\Tests\test_image_array.py:12: PytestDeprecationWarning:
Module 'numpy' was found, but when imported by pytest it raised:
ImportError('\n\nIMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!\n\nImporting the numpy C-extensions failed. This error can happen for\nmany reasons, often due to issues with your setup or how NumPy was\ninstalled.\n\nWe have compiled some common reasons and troubleshooting tips at:\n\n [https://numpy.org/devdocs/user/troubleshooting-importerror.html\n\nPlease](https://numpy.org/devdocs/user/troubleshooting-importerror.html/n/nPlease) note and check the following:\n\n * The Python version is: Python 3.15 from "C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-ktbsigsw\\cp315-win_amd64\\venv-test\\Scripts\\python.exe"\n * The NumPy version is: "2.4.6"\n\nand make sure that they are the versions you expect.\n\nPlease carefully study the information and documentation linked above.\nThis is unlikely to be a NumPy issue but will be caused by a bad install\nor environment on your machine.\n\nOriginal error was: DLL load failed while importing _multiarray_umath: The specified module could not be found.\n')
In pytest 9.1 this warning will become an error by default.
You can fix the underlying problem, or alternatively overwrite this behavior and silence this warning by passing exc_type=ImportError explicitly.
See https://docs.pytest.org/en/stable/deprecations.html#pytest-importorskip-default-behavior-regarding-importerror
numpy = pytest.importorskip("numpy", reason="NumPy not installed")
Tests\test_numpy.py:16
C:\pillow\Tests\test_numpy.py:16: PytestDeprecationWarning:
Module 'numpy' was found, but when imported by pytest it raised:
ImportError('\n\nIMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!\n\nImporting the numpy C-extensions failed. This error can happen for\nmany reasons, often due to issues with your setup or how NumPy was\ninstalled.\n\nWe have compiled some common reasons and troubleshooting tips at:\n\n [https://numpy.org/devdocs/user/troubleshooting-importerror.html\n\nPlease](https://numpy.org/devdocs/user/troubleshooting-importerror.html/n/nPlease) note and check the following:\n\n * The Python version is: Python 3.15 from "C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-ktbsigsw\\cp315-win_amd64\\venv-test\\Scripts\\python.exe"\n * The NumPy version is: "2.4.6"\n\nand make sure that they are the versions you expect.\n\nPlease carefully study the information and documentation linked above.\nThis is unlikely to be a NumPy issue but will be caused by a bad install\nor environment on your machine.\n\nOriginal error was: DLL load failed while importing _multiarray_umath: The specified module could not be found.\n')
In pytest 9.1 this warning will become an error by default.
You can fix the underlying problem, or alternatively overwrite this behavior and silence this warning by passing exc_type=ImportError explicitly.
See https://docs.pytest.org/en/stable/deprecations.html#pytest-importorskip-default-behavior-regarding-importerror
numpy = pytest.importorskip("numpy", reason="NumPy not installed")
Tests/test_map.py::test_ysize
C:\pillow\Tests\test_map.py:37: PytestDeprecationWarning:
Module 'numpy' was found, but when imported by pytest it raised:
ImportError('\n\nIMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!\n\nImporting the numpy C-extensions failed. This error can happen for\nmany reasons, often due to issues with your setup or how NumPy was\ninstalled.\n\nWe have compiled some common reasons and troubleshooting tips at:\n\n [https://numpy.org/devdocs/user/troubleshooting-importerror.html\n\nPlease](https://numpy.org/devdocs/user/troubleshooting-importerror.html/n/nPlease) note and check the following:\n\n * The Python version is: Python 3.15 from "C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-ktbsigsw\\cp315-win_amd64\\venv-test\\Scripts\\python.exe"\n * The NumPy version is: "2.4.6"\n\nand make sure that they are the versions you expect.\n\nPlease carefully study the information and documentation linked above.\nThis is unlikely to be a NumPy issue but will be caused by a bad install\nor environment on your machine.\n\nOriginal error was: DLL load failed while importing _multiarray_umath: The specified module could not be found.\n')
In pytest 9.1 this warning will become an error by default.
You can fix the underlying problem, or alternatively overwrite this behavior and silence this warning by passing exc_type=ImportError explicitly.
See https://docs.pytest.org/en/stable/deprecations.html#pytest-importorskip-default-behavior-regarding-importerror
numpy = pytest.importorskip("numpy", reason="NumPy not installed")
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ===========================
SKIPPED [1] Tests\oss-fuzz\test_fuzzers.py:14: Fuzzer doesn't run on Windows or iOS
SKIPPED [1] Tests\test_arro3.py:27: Arro3 not installed
SKIPPED [1] Tests\test_image_array.py:12: NumPy not installedhttps://github.com/python-pillow/Pillow/actions/runs/27249335954/job/80480198415#step:7:41704 With 9.1: =================================== ERRORS ====================================
_________________ ERROR collecting Tests/test_image_array.py __________________
ImportError while importing test module 'C:\pillow\Tests\test_image_array.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
C:\Users\runneradmin\AppData\Local\Temp\cibw-run-bfoqmbqc\cp315-win_amd64\venv-test\Lib\site-packages\numpy\_core\__init__.py:24: in <module>
from . import multiarray
C:\Users\runneradmin\AppData\Local\Temp\cibw-run-bfoqmbqc\cp315-win_amd64\venv-test\Lib\site-packages\numpy\_core\multiarray.py:11: in <module>
from . import _multiarray_umath, overrides
E ImportError: DLL load failed while importing _multiarray_umath: The specified module could not be found.
The above exception was the direct cause of the following exception:
C:\Users\runneradmin\AppData\Local\Temp\cibw-run-bfoqmbqc\cp315-win_amd64\venv-test\Lib\site-packages\_pytest\python.py:508: in importtestmodule
mod = import_path(
C:\Users\runneradmin\AppData\Local\Temp\cibw-run-bfoqmbqc\cp315-win_amd64\venv-test\Lib\site-packages\_pytest\pathlib.py:596: in import_path
importlib.import_module(module_name)
C:\cibw\nuget-cpython\python.3.15.0-b2\tools\Lib\importlib\__init__.py:88: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<frozen importlib._bootstrap>:1381: in _gcd_import
???
<frozen importlib._bootstrap>:1346: in _find_and_load
???
<frozen importlib._bootstrap>:1305: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:915: in _load_unlocked
???
C:\Users\runneradmin\AppData\Local\Temp\cibw-run-bfoqmbqc\cp315-win_amd64\venv-test\Lib\site-packages\_pytest\assertion\rewrite.py:188: in exec_module
exec(co, module.__dict__)
Tests\test_image_array.py:12: in <module>
numpy = pytest.importorskip("numpy", reason="NumPy not installed")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
C:\cibw\nuget-cpython\python.3.15.0-b2\tools\Lib\importlib\__init__.py:88: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<frozen importlib._bootstrap>:1381: in _gcd_import
???
<frozen importlib._bootstrap>:1346: in _find_and_load
???
<frozen importlib._bootstrap>:1305: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:915: in _load_unlocked
???
<frozen importlib._bootstrap_external>:747: in exec_module
???
<frozen importlib._bootstrap>:549: in _call_with_frames_removed
???
C:\Users\runneradmin\AppData\Local\Temp\cibw-run-bfoqmbqc\cp315-win_amd64\venv-test\Lib\site-packages\numpy\__init__.py:112: in <module>
from numpy.__config__ import show_config
C:\Users\runneradmin\AppData\Local\Temp\cibw-run-bfoqmbqc\cp315-win_amd64\venv-test\Lib\site-packages\numpy\__config__.py:4: in <module>
from numpy._core._multiarray_umath import (
C:\Users\runneradmin\AppData\Local\Temp\cibw-run-bfoqmbqc\cp315-win_amd64\venv-test\Lib\site-packages\numpy\_core\__init__.py:85: in <module>
raise ImportError(msg) from exc
E ImportError:
E
E IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
E
E Importing the numpy C-extensions failed. This error can happen for
E many reasons, often due to issues with your setup or how NumPy was
E installed.
E
E We have compiled some common reasons and troubleshooting tips at:
E
E https://numpy.org/devdocs/user/troubleshooting-importerror.html
E
E Please note and check the following:
E
E * The Python version is: Python 3.15 from "C:\Users\runneradmin\AppData\Local\Temp\cibw-run-bfoqmbqc\cp315-win_amd64\venv-test\Scripts\python.exe"
E * The NumPy version is: "2.4.6"
E
E and make sure that they are the versions you expect.
E
E Please carefully study the information and documentation linked above.
E This is unlikely to be a NumPy issue but will be caused by a bad install
E or environment on your machine.
E
E Original error was: DLL load failed while importing _multiarray_umath: The specified module could not be found.
=========================== short test summary info ===========================
SKIPPED [1] Tests\oss-fuzz\test_fuzzers.py:14: Fuzzer doesn't run on Windows or iOS
SKIPPED [1] Tests\test_arro3.py:27: Arro3 not installed
ERROR Tests/test_image_array.py
!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!
========================= 2 skipped, 1 error in 4.19s =========================https://github.com/python-pillow/Pillow/actions/runs/27486116482/job/81311124359#step:7:37626 |
This would be my preference. I would rather have explicit reminder in the repository, instead of silently skipping and potentially forgetting about it. |
Our Windows AMD64 wheel job has started failing to use NumPy with Python 3.15 - https://github.com/python-pillow/Pillow/actions/runs/27486116482/job/81311124359#step:7:37627
Since NumPy hasn't added support for Python 3.15 yet, this PR simply stops testing our Python 3.15 wheels with NumPy.