Commit Graph

390 Commits

Author SHA1 Message Date
Xiang Dai
e479410564 delete all duplicate empty blanks (#5758)
Signed-off-by: Xiang Dai <764524258@qq.com>
2019-02-20 19:28:50 -08:00
Peter Sobot
50342e4812 Allowed json_format.ParseDict to parse extensions with scalar types. (#5609) 2019-01-31 13:00:23 -08:00
Yilun Chong
0adb74c2d3 Down-integrate internal changes to github. (#5555)
* Down-integrate internal changes to github.

* fix python conformance test

* fix csharp conformance test

* add back java map_lite_test.proto's optimize for option

* fix php conformance test
2019-01-08 15:06:30 -08:00
Paul Yang
1354e469d4
Merge pull request #5502 from TeBoring/github-sync
Down-integrate internal changes to github.
2018-12-20 16:27:26 -08:00
Bo Yang
624a40a387 Down-integrate internal changes to github. 2018-12-20 14:21:20 -08:00
Paul Yang
4dec4f9371
Rebuild python docker image (#5475)
* Rebuild python docker image

* Update docker image

* Change call to build_and_run_docker.sh

* Set up python tests for different versions

* Fix comments
2018-12-18 18:07:24 -08:00
Paul Yang
704037f23a
Change MACOSX_DEPLOYMENT_TARGET to 10.9 (#5406)
* Add kokoro build for python source package

* Use libc++ for xcode 10 (#5303)

The xcode 10 removes the deprecated libstdc++ library. We could set
"MACOSX_DEPLOYMENT_TARGET" to "10.9" to use libc++ instead.

* Add python 3.7 build

* Add build for python 3.7 on linux and windows

* Remove unused source build

* Add comment

* Fix $MACOSX_DEPLOYMENT_TARGET mismatch

* Fix MACOSX_DEPLOYMENT_TARGET mismatch

* Add missing import for sysconfig

* Add missing imports
2018-11-28 16:45:16 -08:00
giokara-oqton
f22be4ddb0 fix json_format.ParseDict modifies input (#5267)
* fix json_format.ParseDict modifies input

* added unit test

* fix naming
2018-11-26 11:08:54 -08:00
Adam Cozzette
0894e07536 Integrated internal changes from Google 2018-11-09 11:28:22 -08:00
Leon Barrett
9e69594adf Fix parsing empty Struct Values from Json (#5211)
* Fix parsing empty Struct Values from Json

This fixes a bug. When parsing a struct from JSON like
    struct = json_format.Parse('{"k": {}}', Struct())
then the struct's "k" value would end up not initialized, and accessing
the value would raise an error.
    In[1]: struct['k']
    ValueError: Value not set
That seems to be because the Struct field of the Value was not set.
    In[2]: struct
    Out[2]:
    fields {
      key: "k"
      value {
      }
    }

This commit makes sure that the Value's Struct field is initialized even
if the Struct has no values itself.

This commit also extends a test to cover this case.

* Additionally test for empty list
2018-10-05 16:38:16 -07:00
Josh Kelley
8d6f8df1ec ParseFromString returns bytes parsed (#5166)
* ParseFromString returns bytes parsed

ParseFromString is documented as returning the number of bytes parsed,
and the C++ implementation does this, so the Python implementation
should too.

See #5165.

* Fix docstring

* Add a test for ParseFromString length behavior
2018-10-05 11:07:55 -07:00
Kevin James
f50a1f843e fix(python): fix deprecated collections.abc usage (#5195)
Many classes within collections were moved to collections.abc in Python
3.3 -- their usage as imported directly from collections is now
deprecated as of Python 3.7 and will be removed soon.

The fallback import added in this PR can be removed entirely when
support for versions of Python prior to 3.3 is dropped.
2018-10-04 16:06:53 -07:00
Benjamin Peterson
188c44b117 Remove 2to3 code from setup.py. (#5114)
Python protobuf has long been a single-source codebase. 2to3 shouldn't need to run in setup.py.
2018-09-10 13:35:38 -07:00
Josh Haberman
e53be9bce4 Fixed Python extension compile. 2018-09-07 13:07:20 -07:00
Josh Haberman
986fad3eb1 Removed obsolete hash_map header that was breaking the compile. 2018-09-07 11:20:04 -07:00
Josh Haberman
d61aede89c Down-integrate from google3. 2018-09-04 10:58:54 -07:00
Feng Xiao
afe98de32a Replace repo links. 2018-08-22 11:55:30 -07:00
Jie Luo
ab09b2a2e2
Disable surrogate check for ucs2 (#5039)
* _SURROGATE_PATTERN check for ucs4
Skip some test for ucs2 by sys.maxunicode
2018-08-14 11:17:16 -07:00
Feng Xiao
14be563f00 Down-integrate proto2 namespace fix. 2018-08-13 12:32:21 -07:00
Feng Xiao
acd5b05e9f Fix failing tests.
1. Fix C++ tests.
  * Add missing files to Makefile.am and fix distcheck in tests.sh
  * Remove BUILT_SOURCES from conformance/Makefile.am.
  * Add some missing override keyword.
  * Add a type cast to int64 because our StrCat() in stubs can't handle size_t.
2. Fix Java tests.
  * Add missing test dependency on guava in pom.xml.
  * Include newly referenced test data in test resources.
  * Manually fix map_lite_test.proto which is overwritten because it's mapped
    from map_test.proto in google3.
  * Add back "optimize_for = LITE_RUNTIME" which is still needed to keep the
    opensource test passing as it's still running lite tests.
  * Add a type cast in newBuilder() because without it the code doesn't compile
    with openjdk javac 1.8 (the compiler can't figure if it's the right type
    due to complex generic typing).
3. Fix Python tests.
  * Remove/replace references to <hash_map>.
  * Suppress more warnings in setup.py.
  * Replace incorrect header inclusion for google/protobuf/proto_api.h.
  * Add strings::EndsWith to google/protobuf/stubs/strutil.h because it's
    referenced in the updated python C extension code.
  * Replace proto2 with google::protobuf. The proto2 name is leaked to
    opensource because we removed the subsitition rule for proto2 namespace
    but only fixed C++ source code and forgot to update python C extension code.
2018-08-09 21:21:01 -07:00
Feng Xiao
a8465b738e Merge master branch. 2018-08-08 17:14:42 -07:00
Feng Xiao
6bbe197e9c Down-integrate from google3. 2018-08-08 17:00:41 -07:00
Adam Cozzette
94d55e5292 Merge branch '3.6.x' into merge-3-6-x 2018-08-01 13:44:55 -07:00
Adam Cozzette
9e1286b949 Updated version numbers to 3.6.1 2018-07-27 13:30:28 -07:00
Arun Olappamanna Vasudevan
c7e0e262a6 pyext needs c++11 in linux and mac. (#4930) 2018-07-23 13:35:15 -07:00
Feng Xiao
2dcd6ae409
Remove/replace travis references (#4953)
* Remove/replace travis references.
2018-07-22 17:14:24 -07:00
Yilun Chong
359889bafd fix python cpp kokoro build 2018-07-15 21:01:48 -07:00
Yilun Chong
14bc658175 fix python cpp kokoro build 2018-07-12 16:49:26 -07:00
Ben Webb
0a59054c30 Add Python 3.7 compatibility (#4862)
Compilation of Python wrappers fails with Python 3.7 because
the Python folks changed their C API such that
PyUnicode_AsUTF8AndSize() now returns a const char* rather
than a char*. Add a patch to work around. Relates #4086.
2018-07-12 10:58:10 -07:00
Thomas Colthurst
79700b56b9 Update message_module.cc (#4835)
* Update message_module.cc

Add missing piece from pull request #4698:  actually initialize the new API object.

* Update message_module.cc
2018-07-03 13:52:27 -07:00
Thomas Colthurst
1ae2cc02b6 Fix capsule name. (#4836)
Internal convert file was broken. Change the capsule to the correct name
2018-06-29 11:07:29 -07:00
Adam Cozzette
d6f346b4d5
Merge pull request #4827 from acozzette/merge-3-6-x
Merge 3.6.x branch into master
2018-06-25 15:52:29 -07:00
Yuchen Xie
595231dd5c Update minimal Python version to 2.7 (#4207) 2018-06-25 15:20:53 -07:00
Adam Cozzette
82d3d7d250 Merge branch '3.6.x' into merge-3-6-x 2018-06-25 13:22:10 -07:00
cclauss
35567c1668 global __version__ In setup.py (#4753)
This change helps both humans and linters to understand the unusual method of instantiating this global variable.
2018-06-25 10:50:40 -07:00
cclauss
35c6927cc1 import inspect (#3507)
Inspect is used five times on line 65-74 without being imported.
2018-06-11 14:17:46 -07:00
Thomas Colthurst
7c6514245b Introduce Proto C API; based on cl/198113115 by amauryfa 2018-05-30 10:33:02 -04:00
Paul Yang
6f723a6624
Always add -std=c++11 for mac (#4684) 2018-05-25 14:42:41 -07:00
Jisi Liu
45eb28b588 Update version number to 3.6.0 2018-05-14 16:06:22 -07:00
Yilun Chong
4a09836e6c Fix python ext build on kokoro (#4527) 2018-05-03 15:55:27 -07:00
Thomas Hisch
451e0446ab Add __init__.py files to compiler and util subpackages (#4117)
The compiler and util subpackages are created by the build_py class in
setup.py. This has caused an issue in the protobuf package in
conda-forge (https://github.com/conda-forge/protobuf-feedstock/issues/40),
which is fixed by this commit.
2018-04-09 12:43:10 -07:00
Paul Yang
3b6d027ba2
For windows, all python version should use /MT (#4468) 2018-04-06 15:43:32 -07:00
Paul Yang
c931743461
Merge branch (#4466)
* Fix setup.py for windows build.

* Bump version number to 3.5.2

* Cat the test-suite.log on errors for presubits
2018-04-02 15:55:28 -07:00
Adam Cozzette
11d26ce24c Removed unused variables in repeated_scalar_container.cc 2018-03-20 14:44:30 -07:00
Adam Cozzette
8b3a72f3e9 Removed unused code pertaining to shared_ptr 2018-03-20 14:44:30 -07:00
Adam Cozzette
c5fcce5f69 Added pyext/thread_unsafe_shared_ptr.h 2018-03-20 13:02:18 -07:00
Adam Cozzette
3fa5dadb61 Removed unrecognized option from no_package.proto 2018-03-20 13:02:18 -07:00
Adam Cozzette
837c94b86f Include no_package.proto in Python test 2018-03-14 13:11:32 -07:00
Adam Cozzette
afe96b6d42 Merge branch 'master' into down-integrate 2018-03-13 16:54:31 -07:00
Adam Cozzette
0400cca323 Integrated internal changes from Google 2018-03-13 16:37:29 -07:00