Deanna Garcia
b36c39236e
Fix bug in _internal_copy_files where the rule would fail in downstream repositories.
...
Taken from https://github.com/protocolbuffers/upb/blob/main/bazel/protobuf.patch#L42
Fixes https://github.com/protocolbuffers/protobuf/issues/12620 .
PiperOrigin-RevId: 528586464
2 years ago
Jie Luo
60be96e0bf
-Make message __deepcopy__ call UPB code instead of default implementation for
...
python UPB (splitted change 2)
PiperOrigin-RevId: 528614850
2 years ago
Deanna Garcia
859410bccc
Fix bug in _internal_copy_files where the rule would fail in downstream repositories.
...
Taken from https://github.com/protocolbuffers/upb/blob/main/bazel/protobuf.patch#L42
Fixes https://github.com/protocolbuffers/protobuf/issues/12620 .
PiperOrigin-RevId: 528586464
2 years ago
Jie Luo
65e047d098
-Make message __deepcopy__ call UPB code instead of default implementation for python UPB (splitted change 1)
...
PiperOrigin-RevId: 528083849
2 years ago
Protobuf Team Bot
51f51ac4ef
Updating version.json and repo version numbers to: 23.0-rc2
2 years ago
Jie Luo
e202f31b78
-Make message CopyFrom() call UPB code instead of default implementation for python UPB
...
-Add upb_Message_Clear() in UPB accessors
-Add upb_Message_CopyFrom() in UPB copy
-Fix UPB upb_Message_DeepClone() bug for repeated extensions
PiperOrigin-RevId: 527644009
2 years ago
Jie Luo
62f1470f09
-Make message CopyFrom() call UPB code instead of default implementation for python UPB
...
-Add upb_Message_Clear() in UPB accessors
-Add upb_Message_CopyFrom() in UPB copy
-Fix UPB upb_Message_DeepClone() bug for repeated extensions
PiperOrigin-RevId: 527644009
2 years ago
Protobuf Team Bot
b21d6be78b
Updating version.json and repo version numbers to: 23.0-rc1
2 years ago
Deanna Garcia
bd6a0cf15b
Delete old numpy_test.py file and replace references with the new one.
...
This is the final step to make numpy/pip_deps a test-only dependency.
PiperOrigin-RevId: 525785717
2 years ago
Deanna Garcia
8c10056074
Add back UPB numpy test now that it has been moved in the protobuf directory.
...
This also includes an update to the newest protobuf commit.
PiperOrigin-RevId: 525551351
2 years ago
Deanna Garcia
13833b1df0
Add numpy test to python_test_srcs target so that the python test wheel will have access to it.
...
PiperOrigin-RevId: 525498162
2 years ago
Deanna Garcia
d18492ece1
Give upb pb_unit_tests visibility to the new numpy_test target.
...
PiperOrigin-RevId: 525197302
2 years ago
Deanna Garcia
d21163731b
Add init file to new google/protobuf/internal/numpy package to have it recognized as a python module
...
PiperOrigin-RevId: 524981114
2 years ago
Deanna Garcia
fe038fc9d2
Make numpy/pip_deps a test-only dependency.
...
Create an isolated build file for the numpy test to separate from runtime.
PiperOrigin-RevId: 524913924
2 years ago
Eric Salo
565c8fe66e
upb: copy the wire decode recursion-depth-checking code to the wire encoder
...
PiperOrigin-RevId: 524873082
2 years ago
Eric Salo
b19c811493
Python: Allow de-serializing bytearray ( #868 )
...
Fix for https://github.com/protocolbuffers/protobuf/issues/10774
Closes #868
PiperOrigin-RevId: 524869277
2 years ago
Alexandre Jasmin
ebaecb7e09
Python: Allow de-serializing bytearray ( #868 )
...
Fix for https://github.com/protocolbuffers/protobuf/issues/10774
Closes #868
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/upb/pull/868 from ajasmin:bugfix/pythondeserialize-bytearray 5afeb11831fd6f2f80d032cfc54fb2e7bbe902ca
PiperOrigin-RevId: 524857599
2 years ago
Deanna Garcia
e6dd5bfefe
Comment out //third_party/upb/python/pb_unit_tests:numpy_test to allow for a change in protobuf directories. This will be uncommented as soon as the protobuf change gets through.
...
PiperOrigin-RevId: 524343065
2 years ago
Protobuf Team Bot
a05c57d43c
Mark sequence containers as Py_TPFLAGS_SEQUENCE, enabling pattern matching
...
PEP634 introduces structural pattern matching. This works out of the box for most parts of protobuf messages, but fails for sequence matching (defined in https://peps.python.org/pep-0634/#sequence-patterns ). This is caused by the underlying containers missing the newly introduced Py_TPFLAGS_SEQUENCE flag (see 069e81ab3d
).
This simply adds the flag, making the following fall into the first case:
```
message = test_pb2.TestMessage(int_sequence=(1, 2, 3))
match message:
case test_pb2.TestMessage(int_sequence=(1, *rest)):
print(f"message.int_sequence is a seq starting with 1, ending in {rest}")
case _:
print(f"No case on 'int_sequence' matched! Value: {message.int_sequence}")
```
PiperOrigin-RevId: 524326722
2 years ago
Eric Salo
69a4876d69
restore pypy support broken when adding 3.11 support (from GH)
...
This is a copy of https://github.com/protocolbuffers/protobuf/pull/12431
but with the ifdef logic reversed. The original PR could not kick off our
CI tests because it wasn't branched directly from repo main.
Thanks to Tom Gillespie for the original PR.
PiperOrigin-RevId: 524041105
2 years ago
Protobuf Team Bot
482156c0f9
Updating version.json and repo version numbers to: 22.3
2 years ago
Protobuf Team Bot
9d2b5d1716
Add upb_MiniTable_FindUnknown depth_limit parameter.
...
Fix UpbMessageIsEqual IsMap fallthrough.
PiperOrigin-RevId: 522961305
2 years ago
Mike Kruskal
d260ab343e
Add windows CI
...
PiperOrigin-RevId: 520478558
2 years ago
Eric Salo
dfb71558a2
sync to current upb and enable new unit test on upb
...
PiperOrigin-RevId: 518643876
2 years ago
Deanna Garcia
eda3f17ed3
Update numpy dependency to 1.22.0.
...
GH advisory on versions < 1.22.0 https://github.com/advisories/GHSA-fpfv-jqm9-f5jm .
PiperOrigin-RevId: 518601694
2 years ago
Eric Salo
579f4ab70d
fix Python bug with required fields
...
https://github.com/protocolbuffers/upb/issues/1220
There were two bugs here: Python was incorrectly mandating that a required
field be set during assignment, and it was also incorrectly assuming a non-NULL
return from an internal function call.
PiperOrigin-RevId: 518561818
2 years ago
Eric Salo
ea4cb79f66
fix Python bug with required fields
...
https://github.com/protocolbuffers/upb/issues/1220
There were two bugs here: Python was incorrectly mandating that a required
field be set during assignment, and it was also incorrectly assuming a non-NULL
return from an internal function call.
PiperOrigin-RevId: 518561818
2 years ago
Karthikeyan Singaravelan
decc1b5708
Update deprecated aliases for Python 3.12 compatibility. ( #12254 )
...
https://docs.python.org/3.12/whatsnew/3.12.html#removed . `assertRaisesRegexp` was removed in favor of `assertRaisesRegex`
Closes #12254
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/12254 from tirkarthi:fix-assert 922f3ceccc
PiperOrigin-RevId: 518181080
2 years ago
Deanna Garcia
666a28e6ac
Update numpy dependency to 1.22.0.
...
GH advisory on versions < 1.22.0 https://github.com/advisories/GHSA-fpfv-jqm9-f5jm .
PiperOrigin-RevId: 518103313
2 years ago
Protobuf Team Bot
8eac9a031e
Remove loop when skipping string field values.
...
No need for a loop that that calls tryConsumeString or tryConsumeByteString repeatedly, since ConsumeByteString already loops itself.
PiperOrigin-RevId: 517202228
2 years ago
Mike Kruskal
bdeacc7fb8
Internal Code Change
...
PiperOrigin-RevId: 516655054
2 years ago
zhangskz
b15bf628e5
Merge 22.x back to main ( #12200 )
...
Closes #12200
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/12200 from protocolbuffers:main-202303101853 1efa2e7205
PiperOrigin-RevId: 515722578
2 years ago
Mike Kruskal
25dfc39b11
Internal changes
...
PiperOrigin-RevId: 515648197
2 years ago
Protobuf Team Bot
81f89d509d
Updating version.json and repo version numbers to: 22.2
2 years ago
deannagarcia
15bd2c21cf
Merge 22.x back to main ( #12169 )
...
Closes #12169
PiperOrigin-RevId: 515161008
2 years ago
Protobuf Team Bot
839e8d25ea
Updating version.json and repo version numbers to: 22.1
2 years ago
Mike Kruskal
0b9134bb4e
Deprecate SupportsUnknownEnumValues on Message reflection. Use FieldDescriptor or EnumDescriptor instead.
...
PiperOrigin-RevId: 514618684
2 years ago
Joshua Haberman
eaa8f24aa6
Updated obsolete Python README.md
...
PiperOrigin-RevId: 513840426
2 years ago
Adam Cozzette
5abab0f47e
Roll-forward of change to add Python support for retention attribute
...
PiperOrigin-RevId: 513318052
2 years ago
Jie Luo
dd9dd86fbc
Raise warnings for MessageFactory class usages
...
PiperOrigin-RevId: 512779287
2 years ago
Karol M. Langner
1b1ca24ae0
Call setUp on super, and fix import order
...
PiperOrigin-RevId: 512200880
2 years ago
Adam Cozzette
3942e53072
Automated rollback of commit 63389c027f
.
...
PiperOrigin-RevId: 512087869
2 years ago
Adam Cozzette
63389c027f
Add Python support for retention attribute
...
PiperOrigin-RevId: 511914565
2 years ago
deannagarcia
56c149863c
Depend on proto file instead of proto library
2 years ago
deannagarcia
491d27e4e6
Add plugin.proto to the list of well known files for python
...
In 21.x, depending on "//python:well_known_types_py_pb2" provided a transitive dependency to `compiler/plugin.proto`. That dependency was incorrectly removed for 22.x.
2 years ago
Mike Kruskal
649cc30872
Open-source some of our string_view tests.
...
This support was added in 22.x, but we don't have any tests locking it down.
Closes https://github.com/protocolbuffers/protobuf/issues/8096
PiperOrigin-RevId: 510242380
2 years ago
Protobuf Team Bot
a847a8dc4b
Updating version.json and repo version numbers to: 22.0
2 years ago
Protobuf Team Bot
a594141cc4
Document known quirks of EnumDescriptor::is_closed() when importing across files with different syntaxes.
...
PiperOrigin-RevId: 509581394
2 years ago
Protobuf Team Bot
1de344fcd1
Document known quirks of EnumDescriptor::is_closed() when importing across files with different syntaxes.
...
PiperOrigin-RevId: 509581394
2 years ago
Protobuf Team Bot
4dd7a1e380
Updating version.json and repo version numbers to: 22.0-rc3
2 years ago