Commit a4508d4
[numpy] Fix breakage in users of Python protobufs under NumPy 2.3rc1. (#22172)
* [numpy] Fix breakage in users of Python protobufs under NumPy 2.3rc1.
As of NumPy 2.3.0rc1, numpy.bool scalars can no longer be interpreted as index values (https://github.com/numpy/numpy/releases/tag/v2.3.0rc1). This causes protobuf no longer to accept a np.bool scalar as a legal value for a boolean field.
We have two options:
a) either we can change protobuf so that it continues to accept NumPy boolean scalars (this change), or
b) decide that protobuf should reject NumPy boolean scalars and that users must update their code to cast to a Python bool explicitly.
I have no strong opinion as to which, but option (a) seems less disruptive.
No test updates are needed: the existing tests fail under NumPy 2.3.
PiperOrigin-RevId: 766629310
* Bump PHP to 8.3 to fix non-hermetic macos failure
* Bump setup-php pin instead of PHP version
---------
Co-authored-by: Peter Hawkins <phawkins@google.com>1 parent ea5369e commit a4508d4
File tree
4 files changed
+56
-8
lines changed- .github/workflows
- python
- google/protobuf
- internal
- pyext
4 files changed
+56
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
229 | 258 | | |
230 | 259 | | |
231 | 260 | | |
| |||
248 | 277 | | |
249 | 278 | | |
250 | 279 | | |
251 | | - | |
252 | | - | |
253 | | - | |
| 280 | + | |
254 | 281 | | |
255 | 282 | | |
256 | 283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
118 | 126 | | |
119 | 127 | | |
120 | 128 | | |
121 | 129 | | |
| 130 | + | |
122 | 131 | | |
123 | 132 | | |
124 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
558 | 558 | | |
559 | 559 | | |
560 | 560 | | |
561 | | - | |
562 | | - | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
563 | 575 | | |
564 | 576 | | |
565 | 577 | | |
| |||
0 commit comments