-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Ensure we test against numpy 2 in CI #11182
base: main
Are you sure you want to change the base?
Conversation
Okay, so there are some doctest failures (I'll push up a fix for that) and a single test failure
@fjetter do you have a moment to look at that test failure? It was added in #10865, which you reviewed |
Unit Test ResultsSee test report for an extended history of previous test failures. This is useful for diagnosing flaky tests. 15 files ± 0 15 suites ±0 3h 22m 19s ⏱️ - 1m 17s For more details on these failures, see this check. Results for commit 48a9b8a. ± Comparison against base commit 36e9d7c. ♻️ This comment has been updated with latest results. |
@@ -1271,6 +1271,7 @@ def test_tokenize_random_functions(module): | |||
"""random.random() and other methods of the global random state do not compare as | |||
equal to themselves after a pickle roundtrip""" | |||
module = eval(module) | |||
module.seed(2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manually setting the random seed here gets this test passing. If we don't do this, then this test fails against NumPy 2 with this tokenization mismatch error:
__________________ test_tokenize_random_functions[np.random] ___________________
[gw0] linux -- Python 3.12.4 /home/runner/miniconda3/envs/test-environment/bin/python3.12
module = <module 'numpy.random' from '/home/runner/miniconda3/envs/test-environment/lib/python3.12/site-packages/numpy/random/__init__.py'>
@pytest.mark.parametrize(
"module",
["random", pytest.param("np.random", marks=pytest.mark.skipif("not np"))],
)
def test_tokenize_random_functions(module):
"""random.random() and other methods of the global random state do not compare as
equal to themselves after a pickle roundtrip"""
module = eval(module)
a = module.random
b = pickle.loads(pickle.dumps(a))
> assert check_tokenize(a) == check_tokenize(b)
E AssertionError: assert '5a758251ee05...fadb5e734ae74' == 'f8c814ecbf02...12210d58c137e'
E
E - f8c814ecbf0209a0c4812210d58c137e
E + 5a758251ee0551802acfadb5e734ae74
dask/tests/test_tokenize.py:1277: AssertionError
@fjetter @phofl @hendrikmakait do any of you have more context here?
NumPy 2 came out over the weekend. We've been testing against the nightly version of
numpy
in ourupstream
build but due to other dependencies,numpy >=2
isn't getting installed on our main CI environments.This PR removes some optional dependencies (e.g.
numba
) to ensurenumpy
2 can be installed in our Python 3.12 builds.