From 414f69ae835ea24504e566c462f68747017cd462 Mon Sep 17 00:00:00 2001 From: Angus Hollands Date: Sat, 28 Oct 2023 09:54:16 +0100 Subject: [PATCH] ci: perform installs in single pass --- .github/workflows/test.yml | 78 ++++++++++++++--------------------- requirements-test-minimal.txt | 5 +++ requirements-test.txt | 4 +- 3 files changed, 38 insertions(+), 49 deletions(-) create mode 100644 requirements-test-minimal.txt diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6f8fc0f3c8..d1340b04c3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -80,11 +80,12 @@ jobs: python -m pip install build python -m build -w awkward-cpp - - name: Install awkward-cpp - run: python -m pip install -v @(get-childitem -path awkward-cpp/dist/*.whl) - - - name: Build & install awkward - run: python -m pip install -v . + - name: Install awkward, awkward-cpp, and dependencies + run: >- + python -m pip install --only-binary "numpy,pandas,pyarrow,numexpr,numexpr" + -v . @(get-childitem -path awkward-cpp/dist/*.whl) + pytest-github-actions-annotate-failures + -r requirements-test.txt - name: Print versions run: python -m pip list @@ -92,9 +93,6 @@ jobs: - name: Check if kernel specification is sorted run: pipx run nox -s diagnostics -- --check-spec-sorted - - name: Install test requirements - run: python -m pip install -v -r requirements-test.txt pytest-github-actions-annotate-failures - - name: Test specification if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true' run: python -m pytest -vv -rs awkward-cpp/tests-spec @@ -156,11 +154,13 @@ jobs: python -m pip install build python -m build -w ./awkward-cpp - - name: Install awkward-cpp - run: python -m pip install -v ./awkward-cpp/dist/*.whl - - - name: Build & install awkward - run: python -m pip install -v . + - name: Install awkward, awkward-cpp, dask-awkward, and dependencies + run: >- + python -m pip install --only-binary "numpy,pandas,pyarrow,numexpr" + -v . ./awkward-cpp/dist/*.whl + pytest-github-actions-annotate-failures + dask-awkward + -r requirements-test.txt - name: Print versions run: python -m pip list @@ -168,9 +168,6 @@ jobs: - name: Check if kernel specification is sorted run: pipx run nox -s diagnostics -- --check-spec-sorted - - name: Install test requirements - run: python -m pip install -v -r requirements-test.txt pytest-github-actions-annotate-failures - - name: Test specification if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true' run: python -m pytest -vv -rs awkward-cpp/tests-spec @@ -190,24 +187,17 @@ jobs: strategy: matrix: python-version: + # This case is covered by our "include" test for 3.12 + - '3.12' - '3.11' - '3.10' - '3.9' - '3.8' - numpy-package: - - "numpy" - pyarrow-package: - - "pyarrow" + extra-pip-constraints: + - "-r requirements-test.txt" include: - python-version: '3.8' - numpy-package: "numpy==1.18.0" - pyarrow-package: "pyarrow" - - python-version: '3.8' - numpy-package: "numpy" - pyarrow-package: "pyarrow==7.0.0" - - python-version: '3.12' - numpy-package: "numpy>=1.26.0b1" - pyarrow-package: "pyarrow;python_version<'3.12'" + extra-pip-constraints: "-r requirements-test-minimal.txt" runs-on: ubuntu-22.04 @@ -246,11 +236,12 @@ jobs: python -m pip install build python -m build -w ./awkward-cpp - - name: Install awkward-cpp - run: python -m pip install -v ./awkward-cpp/dist/*.whl "${{ matrix.numpy-package }}" "${{ matrix.pyarrow-package }}" - - - name: Build & install awkward - run: python -m pip install -v . + - name: Install awkward, awkward-cpp, and dependencies + run: >- + python -m pip install --only-binary "numpy,pandas,pyarrow,numexpr" + -v . ./awkward-cpp/dist/*.whl + pytest-github-actions-annotate-failures + ${{ matrix.extra-pip-constraints }} - name: Print versions run: python -m pip list @@ -258,9 +249,6 @@ jobs: - name: Check if kernel specification is sorted run: pipx run nox -s diagnostics -- --check-spec-sorted - - name: Install test requirements - run: python -m pip install -v -r requirements-test.txt pytest-github-actions-annotate-failures - - name: Test specification if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true' run: python -m pytest -vv -rs awkward-cpp/tests-spec @@ -332,20 +320,16 @@ jobs: python3 -m pip install build python3 -m build -w ./awkward-cpp - - name: Install awkward-cpp - run: python3 -m pip install -v ./awkward-cpp/dist/*.whl - - - name: Build & install awkward - run: python3 -m pip install -v . - - - name: Also install dask-awkward - run: python3 -m pip install dask-awkward + - name: Install awkward, awkward-cpp, dask-awkward, and dependencies + run: >- + python -m pip install --only-binary "numpy,pandas,pyarrow,numexpr" + -v . ./awkward-cpp/dist/*.whl + pytest-github-actions-annotate-failures + dask-awkward + -r requirements-test.txt - name: Print versions run: python -m pip list - - name: Install test requirements - run: python -m pip install -v -r requirements-test.txt pytest-github-actions-annotate-failures - - name: Test run: python -m pytest -vv -rs tests diff --git a/requirements-test-minimal.txt b/requirements-test-minimal.txt new file mode 100644 index 0000000000..ced5d44010 --- /dev/null +++ b/requirements-test-minimal.txt @@ -0,0 +1,5 @@ +numpy==1.18.0 +pyarrow==7.0.0 +pytest>=6 +pytest-cov +pytest-xdist diff --git a/requirements-test.txt b/requirements-test.txt index a46959b0a0..746187dd7e 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,10 +1,10 @@ fsspec;sys_platform != "win32" jax[cpu]>=0.2.15;sys_platform != "win32" and python_version < "3.12" numba>=0.50.0,!=0.58.0rc1;python_version < "3.12" -numexpr; python_version < "3.12" +numexpr>=2.7; python_version < "3.12" pandas>=0.24.0;sys_platform != "win32" and python_version < "3.12" pyarrow>=7.0.0;sys_platform != "win32" and python_version < "3.12" pytest>=6 pytest-cov pytest-xdist -uproot +uproot>=5