Skip to content

TST: skip dlpack tests on numpy 1.2x, dask, and cupy#412

Merged
ev-br merged 1 commit intodata-apis:mainfrom
ev-br:skips_for_dlpack
Apr 3, 2026
Merged

TST: skip dlpack tests on numpy 1.2x, dask, and cupy#412
ev-br merged 1 commit intodata-apis:mainfrom
ev-br:skips_for_dlpack

Conversation

@ev-br
Copy link
Copy Markdown
Member

@ev-br ev-br commented Apr 3, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 3, 2026 11:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Array API test expectations by skipping/xfailing DLPack-related tests for specific backends/versions where DLPack interoperability is not supported or not compliant with the test suite.

Changes:

  • Mark DLPack test cases as xfail/skip for NumPy 1.22 and 1.26.
  • Mark DLPack test cases as xfail/skip for Dask.
  • Mark CuPy 14 DLPack tests as xfail/skip due to copy= keyword argument incompatibility.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
numpy-1-26-xfails.txt Adds DLPack test xfails for NumPy 1.26 runs.
numpy-1-22-xfails.txt Adds DLPack test xfails for NumPy 1.22 runs.
dask-xfails.txt Adds DLPack test xfails for Dask runs.
cupy-xfails.txt Adds DLPack-related xfails for CuPy 14 compatibility.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

array_api_tests/test_special_cases.py::test_unary[tanh(real(x_i) is +infinity and isfinite(imag(x_i)) and imag(x_i) > 0) -> 1 + 0j]


# no dlpack support
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The note # no dlpack support is misleading in this file: from_dlpack is imported from NumPy (and is already referenced in the earlier # 2023.12 support signature xfails). Consider rewording this comment to describe the actual incompatibility being skipped here (e.g., missing __dlpack__/__dlpack_device__ on ndarray, or from_dlpack signature/behavior not matching the Array API tests), so future maintainers know what to re-check when NumPy gains compliant support.

Suggested change
# no dlpack support
# DLPack-related Array API tests are still incompatible: ndarray lacks
# __dlpack__/__dlpack_device__, and NumPy's from_dlpack support does not
# yet match these test expectations.

Copilot uses AI. Check for mistakes.
Comment on lines +88 to +91
# no dlpack support
array_api_tests/test_dlpack.py::test_dlpack_device
array_api_tests/test_dlpack.py::test_dunder_dlpack
array_api_tests/test_dlpack.py::test_from_dlpack
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This DLPack-related xfail block is far away from the existing # 2023.12 support section that already contains the from_dlpack / __dlpack__ signature xfails. To keep the file organized, please move this block next to the other DLPack entries (or add a dedicated DLPack section) so all related xfails are co-located.

Copilot uses AI. Check for mistakes.
array_api_tests/test_special_cases.py::test_unary[acosh(real(x_i) is +0 and imag(x_i) is NaN) -> NaN \xb1 \u03c0j/2]
array_api_tests/test_special_cases.py::test_unary[tanh(real(x_i) is +infinity and isfinite(imag(x_i)) and imag(x_i) > 0) -> 1 + 0j]

# no dlpack support
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as numpy-1-26-xfails.txt: # no dlpack support is too broad here, since from_dlpack exists in NumPy 1.22+ (and this file already has from_dlpack/__dlpack__ signature xfails). Please reword the comment to capture the specific missing/non-compliant pieces that cause these tests to be skipped.

Suggested change
# no dlpack support
# NumPy 1.22 has from_dlpack/__dlpack__, but device handling and full DLPack protocol compliance are still missing/non-compliant

Copilot uses AI. Check for mistakes.
# cupy 13.x follows numpy 1.x w/o weak promotion: result_type(int32, uint8, 1) != result_type(int32, uint8)
array_api_tests/test_data_type_functions.py::TestResultType::test_with_scalars

# CuPy 14 does not support copy= dlpack argument
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment # CuPy 14 does not support copy= dlpack argument is a bit unclear/grammatically off. Please clarify it to explicitly reference the DLPack protocol/__dlpack__ keyword argument (e.g., that CuPy’s __dlpack__/from_dlpack does not accept the copy= keyword expected by the Array API tests).

Suggested change
# CuPy 14 does not support copy= dlpack argument
# CuPy 14's DLPack support (__dlpack__/from_dlpack) does not accept
# the copy= keyword argument expected by the Array API tests.

Copilot uses AI. Check for mistakes.
@ev-br ev-br merged commit 9f3a525 into data-apis:main Apr 3, 2026
32 checks passed
@ev-br ev-br added this to the 1.15 milestone Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants