-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Fix incompatibility with NumPy 1.20 #8187
Conversation
7e60e55
to
b4ee967
Compare
NumPy < 1.24 is EOL - https://endoflife.date/numpy Would an alternative solution be to upgrade NumPy? |
One could argue that numpy < 2.0 is EOL since numpy devs have stated multiple times they cannot backport patches to 1.26 anymore, so I don't think NEP 29 (which I assume is the source for this endoflife page) is to be strictly followed. The presence of this
I should note that I discovered this in CI while explicitly testing a library with its minimal requirements (it has matplotlib pinned but not Pillow, since it's not a direct dependency). If this patch is undesired for some reason, bumping minimal requirements is my next best shot, but I'm emphasizing that it's not about a particular virtualenv that would be broken. |
That sounds like an argument for upgrading NumPy, not for staying on an old version.
I'm mostly conscious of trying to have some line in the sand, so that we're not supporting old versions forever. If this request is just that we support NumPy 1.20 for the next year though, then that is a limited time frame. |
Yes, I'm not planning to support Python 3.9 (hence, numpy 1.20) beyond early 2025. Note that I don't think the new title for this PR is correct: this fixes a runtime crash, type checking isn't the only (or main) concern. |
That is surprising - we install NumPy 1.17 in our Ubuntu 20.04 CI, and our test suite runs without a problem. I'll go further then - neutrinoceros#1 will prevent |
Do not import numpy.typing unless TYPE_CHECKING
I'm not surprised: numpy 1.19 and older or 1.21 and newer all work as intended: only version 1.20 has |
) ### Description Limit numpy version to <2 in tests to pass ci-piplines for 1.16.2. The change in requirements-min.txt is also needed to get the CI's to pass. There's an issue with the python-pillow/Pillow#8187. We did try downgrading the version of pillow but that then failed to build for some reason. ### Motivation and Context <!-- - Why is this change required? What problem does it solve? --> <!-- - If it fixes an open issue, please link to the issue here. --> Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
Fixes an incompatibility encountered in the wild when importing
Pillow==10.4.0
withnumpy==1.20.x
installed.