Skip to content
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: touching of unions #2906

Merged
merged 8 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
run: python -m pip list

- name: Install test requirements
run: python -m pip install -v -r requirements-test.txt
run: python -m pip install -v -r requirements-test-full.txt

- name: Test
run: >-
Expand Down
210 changes: 37 additions & 173 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,38 @@ env:
SOURCE_DATE_EPOCH: "1668811211"

jobs:
Windows:
run-tests:
name: Run Tests
strategy:
matrix:
runs-on:
- windows-latest
- ubuntu-latest
- macos-11
python-version:
- '3.12'
- '3.11'
- '3.10'
- '3.9'
- '3.8'

python-architecture:
- x64

dependencies-kind:
- full
include:
- python-version: '3.9'
python-architecture: x86
runs-on: windows-latest
dependencies-kind: full
- python-version: '3.8'
python-architecture: x64
runs-on: ubuntu-latest
dependencies-kind: minimal

runs-on: windows-2019
runs-on: ${{ matrix.runs-on }}

env:
PIP_ONLY_BINARY: cmake,numpy,pandas
PIP_PRE: "1"
agoose77 marked this conversation as resolved.
Show resolved Hide resolved
PIP_ONLY_BINARY: numpy,pandas,pyarrow,numexpr,numexpr

steps:
- uses: actions/checkout@v4
Expand All @@ -72,177 +82,32 @@ jobs:
uses: actions/cache@v3
with:
path: awkward-cpp/dist
key: ${{ github.job }}-${{ matrix.python-version }}-${{ matrix.python-architecture }}-${{ hashFiles('awkward-cpp/**') }}
key: ${{ github.job }}-${{ matrix.runs-on }}-${{ matrix.python-version }}-${{ matrix.python-architecture }}-${{ hashFiles('awkward-cpp/**') }}

- name: Build awkward-cpp wheel
if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true'
run: |
python -m pip install build
python -m build -w awkward-cpp

- 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

- name: Test specification
if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true'
run: python -m pytest -vv -rs awkward-cpp/tests-spec

- name: Test specification with explicitly defined values
if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true'
run: python -m pytest -vv -rs awkward-cpp/tests-spec-explicit

- name: Test CPU kernels
if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true'
run: python -m pytest -vv -rs awkward-cpp/tests-cpu-kernels

- name: Test
run: python -m pytest -vv -rs tests

MacOS:
strategy:
matrix:
python-version:
- '3.12'
- '3.11'
- '3.10'
- '3.9'
- '3.8'

runs-on: macos-11

env:
PIP_ONLY_BINARY: cmake,numpy
PIP_PRE: "1"

steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: 'Python ${{ matrix.python-version }}'
uses: actions/setup-python@v5
with:
python-version: '${{ matrix.python-version }}'
allow-prereleases: true

- name: Debug wheel tags
run: python -m pip debug --verbose

- name: Generate build files
run: pipx run nox -s prepare -- --headers --signatures --tests

- name: Cache awkward-cpp wheel
id: cache-awkward-cpp-wheel
uses: actions/cache@v3
- name: Find built wheel
uses: tj-actions/glob@v17
id: find-wheel
with:
path: ./awkward-cpp/dist
key: ${{ github.job }}-${{ matrix.python-version }}-${{ hashFiles('awkward-cpp/**') }}

- name: Build awkward-cpp wheel
if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true'
run: |
python -m pip install build
python -m build -w ./awkward-cpp

- 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: Test specification
if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true'
run: python -m pytest -vv -rs awkward-cpp/tests-spec

- name: Test specification with explicitly defined values
if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true'
run: python -m pytest -vv -rs awkward-cpp/tests-spec-explicit

- name: Test CPU kernels
if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true'
run: python -m pytest -vv -rs awkward-cpp/tests-cpu-kernels

- name: Test
run: python -m pytest -vv -rs tests

Linux:
strategy:
matrix:
python-version:
- '3.12'
- '3.11'
- '3.10'
- '3.9'
- '3.8'
extra-pip-constraints:
- "-r requirements-test.txt"
include:
# Lower bounds
- python-version: '3.8'
extra-pip-constraints: "-r requirements-test-minimal.txt"

runs-on: ubuntu-22.04

env:
PIP_ONLY_BINARY: cmake

steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: 'Python ${{ matrix.python-version }}'
uses: actions/setup-python@v5
with:
python-version: '${{ matrix.python-version }}'
allow-prereleases: true

- name: Oldest supported CMake
uses: jwlawson/actions-setup-cmake@v1.14
with:
cmake-version: '3.15.x'

- name: Generate build files
run: pipx run nox -s prepare -- --headers --signatures --tests

- name: Cache awkward-cpp wheel
id: cache-awkward-cpp-wheel
uses: actions/cache@v3
with:
path: ./awkward-cpp/dist
key: ${{ github.job }}-${{ matrix.python-version }}-cmake315-${{ hashFiles('awkward-cpp/**') }}

- name: Build awkward-cpp wheel
if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true'
run: |
python -m pip install build
python -m build -w ./awkward-cpp
files: |
awkward-cpp/dist/*.whl

- 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 }}
python -m pip install -v . ${{ steps.find-wheel.outputs.paths }} pytest-github-actions-annotate-failures
-r "requirements-test-${{ matrix.dependencies-kind }}.txt"

- name: Print versions
run: python -m pip list

- name: Check if kernel specification is sorted
# We don't need to run this all the time
if: matrix.python-version == '3.12'
if: (matrix.python-version == '3.12') && (matrix.runs-on == 'ubuntu-latest')
run: pipx run nox -s diagnostics -- --check-spec-sorted

- name: Test specification
Expand All @@ -257,20 +122,21 @@ jobs:
if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true'
run: python -m pytest -vv -rs awkward-cpp/tests-cpu-kernels

- name: Test
- name: Test non-kernels
run: >-
python -m pytest -vv -rs tests --cov=awkward --cov-report=term
--cov-report=xml

- name: Upload Codecov results
if: (matrix.python-version == '3.9') && (matrix.runs-on == 'ubuntu-latest')
uses: codecov/codecov-action@v3
if: matrix.python-version == '3.9'

Linux-ROOT-dask-awkward:

Linux-ROOT:
runs-on: ubuntu-20.04

env:
PIP_ONLY_BINARY: cmake
PIP_ONLY_BINARY: numpy,pandas,pyarrow,numexpr,numexpr

timeout-minutes: 30

Expand All @@ -290,6 +156,7 @@ jobs:
# Cache invalidates daily by default
cache-environment: true
environment-name: awkward
# Need Python 3.8 for the cached wheels
create-args: >-
python=3.8
numpy
Expand All @@ -311,13 +178,12 @@ jobs:
python3 -m pip install build
python3 -m build -w ./awkward-cpp

- name: Install awkward, awkward-cpp, dask-awkward, and dependencies
- 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
dask-awkward
-r requirements-test.txt
-r requirements-test-full.txt

- name: Print versions
run: python -m pip list
Expand All @@ -331,7 +197,7 @@ jobs:
runs-on: ubuntu-22.04

env:
PIP_ONLY_BINARY: cmake
PIP_ONLY_BINARY: numpy,pandas,pyarrow,numexpr,numexpr

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -364,14 +230,12 @@ jobs:
with:
image: "docker.io/agoose77/cppyy-wheels:cp311"
path: "/wheels/."
destination: "/tmp/cppyy-wheels"
destination: "/tmp/wheelhouse"

- 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
/tmp/cppyy-wheels/*
python -m pip install -v --only-binary "numpy,pandas,pyarrow,numexpr"
./ ./awkward-cpp/dist/*.whl /tmp/wheelhouse/* pytest-github-actions-annotate-failures

- name: Print versions
run: python -m pip list
Expand Down
2 changes: 1 addition & 1 deletion awkward-cpp/include/awkward/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace awkward {
quote(const std::string& x);

/// @brief Exhaustive list of runtime errors possible in the ForthMachine.
enum class ForthError {
enum class EXPORT_SYMBOL ForthError {
// execution can continue
none,

Expand Down
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def tests(session):
"""
Run the unit and regular tests.
"""
session.install("-r", "requirements-test.txt", "./awkward-cpp", ".")
session.install("-r", "requirements-test-full.txt", "./awkward-cpp", ".")
session.run("pytest", *session.posargs if session.posargs else ["tests"])


Expand Down Expand Up @@ -65,7 +65,7 @@ def coverage(session):
"""
Run the unit and regular tests.
"""
session.install("-r", "requirements-test.txt", "./awkward-cpp", ".")
session.install("-r", "requirements-test-full.txt", "./awkward-cpp", ".")
session.run(
"pytest", "tests", "--cov=awkward", "--cov-report=xml", *session.posargs
)
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ include = [
"/CITATION.cff",
"/CONTRIBUTING.md",
"/README.md",
"/requirements-test.txt"
"/requirements-test-full.txt",
"/requirements-test-minimal.txt"
]
artifacts = [
"/tests-cuda-kernels"
Expand Down
File renamed without changes.
Loading