Skip to content

Commit 36b7ff9

Browse files
authored
Merge pull request numpy#27085 from ngoldbaum/misc-free-threading-fixes
ENH: fixes for warnings on free-threaded wheel builds
2 parents 893215a + 38e81bb commit 36b7ff9

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

numpy/_core/tests/test_nep50_promotions.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -352,18 +352,11 @@ def legacy_no_warn():
352352
np._set_promotion_state("legacy")
353353
b.wait()
354354
assert np._get_promotion_state() == "legacy"
355-
# turn warnings into errors, this should not warn with
356-
# legacy promotion state
357-
with warnings.catch_warnings():
358-
warnings.simplefilter("error")
359-
np.float16(1) + 131008
360355

361356
def weak_warn():
362357
np._set_promotion_state("weak")
363358
b.wait()
364359
assert np._get_promotion_state() == "weak"
365-
with pytest.raises(RuntimeWarning):
366-
np.float16(1) + 131008
367360

368361
task1 = threading.Thread(target=legacy_no_warn)
369362
task2 = threading.Thread(target=weak_warn)

numpy/linalg/tests/test_linalg.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import os
55
import sys
66
import itertools
7+
import threading
78
import traceback
89
import textwrap
910
import subprocess
@@ -1943,7 +1944,9 @@ def test_generalized_raise_multiloop():
19431944

19441945
assert_raises(np.linalg.LinAlgError, np.linalg.inv, x)
19451946

1946-
1947+
@pytest.mark.skipif(
1948+
threading.active_count() > 1,
1949+
reason="skipping test that uses fork because there are multiple threads")
19471950
def test_xerbla_override():
19481951
# Check that our xerbla has been successfully linked in. If it is not,
19491952
# the default xerbla routine is called, which prints a message to stdout

numpy/random/_examples/cython/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if not cy.version().version_compare('>=3.0.6')
1212
endif
1313

1414
base_cython_args = []
15-
if cy.version().version_compare('>=3.1.0a0')
15+
if cy.version().version_compare('>=3.1.0')
1616
base_cython_args += ['-Xfreethreading_compatible=True']
1717
endif
1818

0 commit comments

Comments
 (0)