(base_env) ankith@AnkithLaptop:~/mount/gitstuff/personal/pygame-community/pygame-ce$ ruff check . --select NPY201
test/pixelcopy_test.py:548:25: NPY201 [*] `np.alltrue` will be removed in NumPy 2.0. Use `all` instead.
test/pixelcopy_test.py:556:25: NPY201 [*] `np.alltrue` will be removed in NumPy 2.0. Use `all` instead.
test/pixelcopy_test.py:566:25: NPY201 [*] `np.alltrue` will be removed in NumPy 2.0. Use `all` instead.
test/sndarray_test.py:31:25: NPY201 [*] `np.alltrue` will be removed in NumPy 2.0. Use `all` instead.
test/sndarray_test.py:74:25: NPY201 [*] `np.alltrue` will be removed in NumPy 2.0. Use `all` instead.
test/sndarray_test.py:113:25: NPY201 [*] `np.alltrue` will be removed in NumPy 2.0. Use `all` instead.
test/surfarray_test.py:238:33: NPY201 [*] `np.alltrue` will be removed in NumPy 2.0. Use `all` instead.
test/surfarray_test.py:246:17: NPY201 [*] `np.alltrue` will be removed in NumPy 2.0. Use `all` instead.
test/surfarray_test.py:260:21: NPY201 [*] `np.alltrue` will be removed in NumPy 2.0. Use `all` instead.
test/surfarray_test.py:265:21: NPY201 [*] `np.alltrue` will be removed in NumPy 2.0. Use `all` instead.
test/surfarray_test.py:293:29: NPY201 [*] `np.alltrue` will be removed in NumPy 2.0. Use `all` instead.
Found 11 errors.
[*] 11 fixable with the `--fix` option.
Fixed all these issues by replacing the alltrue import with the all import, now aliased to np_all to prevent name collision with python's builtin all.
Also fixed a few incorrect sndarray testcases and added a skip for a failing surfarray test (we will deal with it in the future)
PS: the numpy.all function is numpy v1 API, so now our tests can run on both numpy v1 and numpy v2
Using the ruff plugin suggested in NumPy 2.0 migration guide
Fixed all these issues by replacing the
alltrue
import with theall
import, now aliased tonp_all
to prevent name collision with python's builtinall
.Also fixed a few incorrect
sndarray
testcases and added a skip for a failingsurfarray
test (we will deal with it in the future)PS: the
numpy.all
function isnumpy v1
API, so now our tests can run on both numpy v1 and numpy v2