diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5afa88ac90..46a61b4424 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -53,6 +53,10 @@ jobs: python-architecture: x86 runs-on: windows-latest dependencies-kind: full + - python-version: '3.9' + python-architecture: x86 + runs-on: windows-latest + dependencies-kind: numpy1 - python-version: '3.8' python-architecture: x64 runs-on: ubuntu-latest @@ -61,18 +65,6 @@ jobs: python-architecture: x64 runs-on: ubuntu-latest dependencies-kind: pypy - - python-version: '3.11' - python-architecture: x64 - runs-on: ubuntu-latest - dependencies-kind: numpy2 - - python-version: '3.11' - python-architecture: x64 - runs-on: macos-11 - dependencies-kind: numpy2 - - python-version: '3.11' - python-architecture: x64 - runs-on: windows-latest - dependencies-kind: numpy2 runs-on: ${{ matrix.runs-on }} diff --git a/dev/generate-tests.py b/dev/generate-tests.py index 4eb9fefc3d..12c65708ec 100644 --- a/dev/generate-tests.py +++ b/dev/generate-tests.py @@ -425,6 +425,7 @@ def genspectests(specdict): """ ) f.write("import pytest\nimport kernels\n\n") + f.write("import pytest\nimport numpy as np\nimport kernels\n\n") num = 1 if spec.tests == []: f.write( diff --git a/requirements-test-numpy1.txt b/requirements-test-numpy1.txt new file mode 100644 index 0000000000..d4fa830d19 --- /dev/null +++ b/requirements-test-numpy1.txt @@ -0,0 +1,4 @@ +numpy<2.0.0 +pytest>=6 +pytest-cov +pytest-xdist diff --git a/requirements-test-numpy2.txt b/requirements-test-numpy2.txt deleted file mode 100644 index 57f93af2cb..0000000000 --- a/requirements-test-numpy2.txt +++ /dev/null @@ -1,5 +0,0 @@ -fsspec>=2022.11.0;sys_platform != "win32" -numpy>=2.0.0b1 -pytest>=6 -pytest-cov -pytest-xdist diff --git a/src/awkward/_reducers.py b/src/awkward/_reducers.py index 4c0d52c756..bb8fc22675 100644 --- a/src/awkward/_reducers.py +++ b/src/awkward/_reducers.py @@ -62,7 +62,9 @@ def _dtype_for_kernel(cls, dtype: DTypeLike) -> DTypeLike: else: return dtype - _use32 = (ak._util.win or ak._util.bits32) and not ak._util.numpy2 + _use32 = ((ak._util.win or ak._util.bits32) and not ak._util.numpy2) or ( + ak._util.numpy2 and np.intp is np.int32 + ) @classmethod def _promote_integer_rank(cls, given_dtype: DTypeLike) -> DTypeLike: