Skip to content

Commit 5d0e6d9

Browse files
committed
Enforce deprecation of np attributes deprecated in NumPy 1.20
Also fail when attributes are used in eval expressions. This prepares for upgrade to NumPy 1.24 which removes deprecated names.
1 parent ffa819e commit 5d0e6d9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pyproject.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,15 @@ skip-magic-trailing-comma = true
77
[tool.pytest.ini_options]
88
filterwarnings = [
99
"ignore:Matplotlib is currently using agg:UserWarning",
10+
# TODO(#5967) - remove after upgrade to NumPy 1.24
11+
# Enforce NumPy 1.20 deprecations.
12+
# Ref: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
13+
"error:`np.bool` is a deprecated alias:DeprecationWarning:(cirq|<string>)",
14+
"error:`np.int` is a deprecated alias:DeprecationWarning:(cirq|<string>)",
15+
"error:`np.float` is a deprecated alias:DeprecationWarning:(cirq|<string>)",
16+
"error:`np.complex` is a deprecated alias:DeprecationWarning:(cirq|<string>)",
17+
"error:`np.object` is a deprecated alias:DeprecationWarning:(cirq|<string>)",
18+
"error:`np.str` is a deprecated alias:DeprecationWarning:(cirq|<string>)",
19+
"error:`np.long` is a deprecated alias:DeprecationWarning:(cirq|<string>)",
20+
"error:`np.unicode` is a deprecated alias:DeprecationWarning:(cirq|<string>)",
1021
]

0 commit comments

Comments
 (0)