File: disable-test-of-unsupported-libraries.patch

package info (click to toggle)
python-array-api-compat 1.11.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 708 kB
  • sloc: python: 3,954; sh: 16; makefile: 15
file content (104 lines) | stat: -rw-r--r-- 3,357 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
Description: Disable tests that depend on libraries not in the archive
 This includes: cupy, jax, array-api-strict, sparse (not in good shape)
Author: Shengqi Chen <harry@debian.org>
Forwarded: not-needed
Last-Update: 2025-02-26
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/tests/test_common.py
+++ b/tests/test_common.py
@@ -22,23 +22,23 @@
 
 is_array_functions = {
     'numpy': 'is_numpy_array',
-    'cupy': 'is_cupy_array',
+#    'cupy': 'is_cupy_array',
     'torch': 'is_torch_array',
     'dask.array': 'is_dask_array',
-    'jax.numpy': 'is_jax_array',
-    'sparse': 'is_pydata_sparse_array',
-    'ndonnx': 'is_ndonnx_array',
+#    'jax.numpy': 'is_jax_array',
+#    'sparse': 'is_pydata_sparse_array',
+#    'ndonnx': 'is_ndonnx_array',
 }
 
 is_namespace_functions = {
     'numpy': 'is_numpy_namespace',
-    'cupy': 'is_cupy_namespace',
+#    'cupy': 'is_cupy_namespace',
     'torch': 'is_torch_namespace',
     'dask.array': 'is_dask_namespace',
-    'jax.numpy': 'is_jax_namespace',
-    'sparse': 'is_pydata_sparse_namespace',
-    'array_api_strict': 'is_array_api_strict_namespace',
-    'ndonnx': 'is_ndonnx_namespace',
+#    'jax.numpy': 'is_jax_namespace',
+#    'sparse': 'is_pydata_sparse_namespace',
+#    'array_api_strict': 'is_array_api_strict_namespace',
+#    'ndonnx': 'is_ndonnx_namespace',
 }
 
 
--- a/tests/test_no_dependencies.py
+++ b/tests/test_no_dependencies.py
@@ -49,8 +49,7 @@
 # TODO: Test that wrapper for library X doesn't depend on wrappers for library
 # Y (except most array libraries actually do themselves depend on numpy).
 
-@pytest.mark.parametrize("library", ["cupy", "numpy", "torch", "dask.array",
-                                     "jax.numpy", "sparse", "array_api_strict"])
+@pytest.mark.parametrize("library", ["numpy", "torch", "dask.array"])
 def test_numpy_dependency(library):
     # This import is here because it imports numpy
     from ._helpers import import_
--- a/tests/_helpers.py
+++ b/tests/_helpers.py
@@ -2,10 +2,8 @@
 
 import pytest
 
-wrapped_libraries = ["numpy", "cupy", "torch", "dask.array"]
-all_libraries = wrapped_libraries + [
-    "array_api_strict", "jax.numpy", "ndonnx", "sparse"
-]
+wrapped_libraries = ["numpy", "torch", "dask.array"]
+all_libraries = wrapped_libraries
 
 def import_(library, wrapper=False):
     pytest.importorskip(library)
--- a/tests/test_array_namespace.py
+++ b/tests/test_array_namespace.py
@@ -2,7 +2,6 @@
 import sys
 import warnings
 
-import jax
 import numpy as np
 import pytest
 import torch
@@ -76,6 +75,7 @@
         subprocess.run([sys.executable, "-c", code], check=True)
 
 def test_jax_zero_gradient():
+    return
     jx = jax.numpy.arange(4)
     jax_zero = jax.vmap(jax.grad(jax.numpy.float32, allow_int=True))(jx)
     assert array_namespace(jax_zero) is array_namespace(jx)
--- a/tests/test_dask.py
+++ b/tests/test_dask.py
@@ -1,6 +1,5 @@
 from contextlib import contextmanager
 
-import array_api_strict
 import dask
 import numpy as np
 import pytest
@@ -167,6 +166,7 @@
 @pytest.mark.parametrize("func", ["sort", "argsort"])
 def test_sort_argsort_meta(xp, func):
     """Test meta-namespace other than numpy"""
+    return # no array_api_strict in Debian
     typ = type(array_api_strict.asarray(0))
     a = da.random.random(10)
     b = a.map_blocks(array_api_strict.asarray)