BUG: Add __array_api_version__
to numpy.array_api
namespace
#22365
+3
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Array API has always required namespaces have a
__array_api_version__
attribute (see Versioning), although we all missed it heh (hopefully we can make this more visible in the spec data-apis/array-api#480). This PR introduces such an attribute.This also fixes the issue identified in #22357 (comment) where a Hypothesis update (
6.55.0
) broke CI, as it required using this (specified!) attribute when usinghypothesis.extra.array_api.make_strategies_namespace()
, like we do innumpy/numpy/array_api/tests/test_set_functions.py
Line 7 in 7191d9a
This PR should mean this PR works on Hypothesis versions both before and after
6.55.0
.