Commit Graph

679 Commits

Author SHA1 Message Date
Adam Cozzette
18521f6055 Merge branch '3.19.x' into merge-3.19.x 2022-01-28 17:42:21 +00:00
Adam Cozzette
22d0e265de
Update protobuf version for 3.19.4 (#9449)
I also updated the PHP release notes in
php/ext/google/protobuf/package.xml.
2022-01-27 19:35:56 -08:00
Maximilian
82372d8fe6
Use proper SPDX license identifier (#9441)
The previously used term "3-Clause BSD License" is not properly
standarized. A common standard is SPDX, therefore "3-Clause BSD License"
is substituted with "BSD-3-Clause" which is a SPDX identifier.

`grep -rl "3-Clause BSD License" | xargs -n1 sed -i "s/3-Clause BSD
License/BSD-3-Clause/g"`
2022-01-27 00:23:14 +00:00
Adam Cozzette
a035bd0882
Make libprotobuf symbols local on OSX (#8346) (#9435)
@gnossen gave a great overview in https://github.com/grpc/grpc/pull/24992 of the overall problem.

If a python process using both protobuf _and_ another native library linking in libprotobuf
frequently can cause crashes.  This seems to frequently affect tensorflow as well:

tensorflow/tensorflow#8394,
tensorflow/tensorflow#9525 (comment)
tensorflow/tensorflow#24976,
tensorflow/tensorflow#35573,
https://github.com/tensorflow/tensorflow/blob/v2.0.0/tensorflow/contrib/makefile/rename_protobuf.sh,
tensorflow/tensorflow#16104

Testing locally this fixes both crashes when linking in multiple versions of protobuf
and fixes `DescriptorPool` clashes as well (e.g. Python and Native code import different versions of the same message).

Co-authored-by: Roy Williams <roy.williams.iii@gmail.com>
2022-01-25 08:24:12 -08:00
Adam Cozzette
5bb34e9930 Merge branch '3.19.x' into merge-3.19.x 2022-01-11 18:07:17 +00:00
Adam Cozzette
cc7b1b5323 Update protobuf version 2022-01-10 18:08:15 -08:00
Adam Cozzette
203c593b96 Fix build error with Python 3.10 build on Windows
The Windows build for Python 3.10 is giving us an error about ssize_t
being undefined, so this commit fixes the problem by replacing it with
Py_ssize_t, which is consistent with what we do elsewhere in the file.
2022-01-10 16:55:04 -08:00
Adam Cozzette
922a7ec189 Fix Python 3.10 C++ tests (#9128)
The first change is to make sure we always define PY_SSIZE_T_CLEAN
before including Python.h. Starting from Python 3.10 this is required.
Otherwise we get errors like this:

SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats

The second change is to update reflection_test.py to account for the
fact that with Python 3.10, we get a TypeError even with the C++
implementation when trying to assign a float to a bool field. I'm not
sure why this changed with Python 3.10, but it seems like a good thing
since this is the desired behavior anyway.
2022-01-10 16:55:04 -08:00
Adam Cozzette
eb94f17a8b Update protobuf version 2022-01-05 10:05:11 -08:00
tomerv
47e05427e3
Fix typo in docstring (#9208) 2021-11-10 17:03:55 -08:00
Adam Cozzette
7ccf4d8f67
Merge pull request #9169 from protocolbuffers/3.19.x
Merge 3.19.x into master
2021-11-02 10:10:47 -07:00
Thomas Hisch
26603a1466
Remove unittest2 imports (#9171)
They were only needed for python versions <= 2.6

Related: #6658
2021-10-30 11:56:40 -07:00
Adam Cozzette
7c40b2df1f
Update protobuf version (#9167) 2021-10-28 14:07:53 -07:00
Nipunn Koorapati
0707f2e7f5
Provide a type alias field ValueType on EnumTypeWrapper (#8182)
This should provide a runtime alias, which can be
used in mypy stubs to provide better typing for enum values

Fixes #8175
2021-10-21 15:09:41 -07:00
Adam Cozzette
e6430dd4a0
Merge pull request #9136 from protocolbuffers/3.19.x
Merge 3.19.x into master
2021-10-21 11:45:51 -07:00
Adam Cozzette
63f952b987
Fix Python 3.10 C++ tests (#9128)
The first change is to make sure we always define PY_SSIZE_T_CLEAN
before including Python.h. Starting from Python 3.10 this is required.
Otherwise we get errors like this:

SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats

The second change is to update reflection_test.py to account for the
fact that with Python 3.10, we get a TypeError even with the C++
implementation when trying to assign a float to a bool field. I'm not
sure why this changed with Python 3.10, but it seems like a good thing
since this is the desired behavior anyway.
2021-10-20 14:51:07 -07:00
Adam Cozzette
17b30e9647
Update protobuf version (#9119) 2021-10-20 10:14:02 -07:00
Adam Cozzette
3f3e6f47c6
Update version to 3.19.0-rc2 and fix changelog about Java 7 (#9116)
* Update protobuf version

* Update CHANGES.txt to reflect that we're not yet dropping Java 7
2021-10-19 09:01:57 -07:00
Adam Cozzette
454778d011
Python: fix usages of deprecated assertRaisesRegxp (#9098)
assertRaisesRegexp has been deprecated in favor of the slightly
different spelling assertRaisesRegex. Let's fix this just to clean up a
bunch of deprecation warnings in the tests.
2021-10-15 19:00:04 -07:00
deannagarcia
df5b7fabb8
Merge pull request #7498 from psobot/add-python-descriptor-debug-string
Add GetDebugString to Python FileDescriptor interface.
2021-10-15 15:03:02 -07:00
deannagarcia
6c0168bd65
Merge pull request #7016 from roehling/fix-6205-unknown-fields-integer-overflow
Prevent integer overflow for unknown fields in Python
2021-10-15 14:59:57 -07:00
Adam Cozzette
519340d662
Update protobuf version (#9106) 2021-10-15 14:33:06 -07:00
Adam Cozzette
f367bfb13d
Use dedicated helper functions for map descriptors (#9099)
The Descriptor class now has map_key() and map_value() methods for
accessing the special key and value fields in generated map entry
messages. This commit updates all the relevant code to use these
accessors instead of the clunkier FindFieldByName("key") or
FindFieldByName("value") approach.
2021-10-15 14:26:54 -07:00
Bu Sun Kim
c01cd6ec79
Add python 3.10 (#9034)
* Add python 3.10

* Update setup.py and tox.ini

* fix: fix 3.9 -> 3.10

* fix: py310-cpp
2021-10-15 10:24:49 -07:00
Peter Sobot
ef0bd1343b Only run GetDebugString test with cpp impl. 2021-10-15 11:39:21 -04:00
Timo Röhling
5100be2b77 Prevent integer overflow for unknown fields
The PyInt_FromLong() conversion function will truncate 64 bit integer
values on 32 bit architectures. We will now use the PyLong_* functions
with the appropriate minimum size for each field.

Note that this commit also switches to the unsigned versions, since the
unknown integer fields have been declared unsigned anyway.

Fixes #6205
2021-10-14 23:30:01 +02:00
Peter Sobot
4e176f29b4 Added GetDebugString to Python FileDescriptor interface. 2021-10-14 16:51:22 -04:00
deannagarcia
12f70b7c4d
Merge pull request #8122 from mamapanda/MessageToDict-fix
Make MessageToDict convert map keys to strings
2021-10-14 11:12:34 -07:00
Raul Bocanegra Algarra
e47ed057a5
Make glob recursive if option is enabled (#8783) 2021-10-13 09:13:18 -07:00
Adam Cozzette
3afc828309 Sync from Piper @401883098
PROTOBUF_SYNC_PIPER
2021-10-08 16:45:26 -07:00
Adam Cozzette
2a75e8ca58 Merge branch '3.18.x' into merge-3.18.x 2021-10-05 14:04:13 -07:00
Adam Cozzette
0dab03ba7b
Update protobuf version to 3.18.1 (#9051)
* Update protobuf version

* Update PHP release notes in package.xml
2021-10-04 17:43:33 -07:00
Josh Haberman
129b3e8a98 Merge branch 'master' into sync-stage 2021-09-28 15:28:48 +00:00
Joshua Haberman
567efd4c3e
Merge pull request #9026 from haberman/merge-release
Merge 3.18.x release branch to master
2021-09-27 17:55:39 -07:00
Joshua Haberman
2128ce074f Merge branch '3.18.x' into merge-release 2021-09-27 15:29:06 -07:00
Josh Haberman
28c52fd5c4 Merge tag 'refs/tags/sync-piper' into sync-stage 2021-09-27 19:18:42 +00:00
Josh Haberman
624d29d833 Sync from Piper @399250367
PROTOBUF_SYNC_PIPER
2021-09-27 19:18:41 +00:00
AN Long
2fffff8320 Add python-requires in setup.py (#8989)
* Add python-requires in setup.py

* Update setup.py
2021-09-24 12:30:46 -07:00
AN Long
b75bb09551
Add python-requires in setup.py (#8989)
* Add python-requires in setup.py

* Update setup.py
2021-09-22 15:09:39 -07:00
Vasily Fomin
8b59d5367c
Fix typo in Descriptor docstring (#9001) 2021-09-22 14:11:29 -07:00
Paul Yang
12fb2b7450
Update protobuf version (#8973)
* Update protobuf version

* Update php notes
2021-09-13 12:34:03 -07:00
Sandy Zhang
565294d79f Remove duplicate build_ext class and get_ext_filename method 2021-09-11 00:14:28 +00:00
Sandy Zhang
c43d053c1b Merge tag 'refs/tags/sync-piper' into sync-stage 2021-09-10 20:04:53 +00:00
Sandy Zhang
215dd1335b Sync from Piper @395989630
PROTOBUF_SYNC_PIPER
2021-09-10 20:04:52 +00:00
Jan Tattermusch
3efd68c793 Reintroduce setup.py changes from #8280 erased by piper import #8902 2021-09-10 09:53:31 +02:00
Joshua Haberman
359594f4bb Removed Python 2.x support for Python. 2021-09-09 17:45:49 -07:00
Joshua Haberman
c70b4e570b Removed remaining dependence on six for Python. 2021-09-09 13:38:21 -07:00
Joshua Haberman
a33aa736fc Removed more testing of Python <3.5. 2021-09-09 13:20:34 -07:00
Joshua Haberman
018e2e7751 Merge tag 'refs/tags/sync-piper' into sync-stage
# Conflicts:
#	src/google/protobuf/descriptor.pb.cc
#	src/google/protobuf/duration.pb.cc
#	src/google/protobuf/timestamp.pb.cc
#	src/google/protobuf/type.pb.cc
#	src/google/protobuf/wrappers.pb.cc
2021-09-09 08:23:12 -07:00
Joshua Haberman
e5c570bb57 Sync from Piper @395706834
PROTOBUF_SYNC_PIPER
2021-09-09 08:21:42 -07:00