Commit Graph

7272 Commits

Author SHA1 Message Date
David L. Jones
6f129c123e
Update docs so we can generate better output from Sphinx. (#7295)
This change updates docstrings and comments so that they will produce nicer
formatting and cross-references from Sphinx. There are a few broad categories of
changes:

- Paramter and attribute docs are updated so that types will be recognized by
  Napoleon (https://sphinxcontrib-napoleon.readthedocs.io/en/latest/) This
  usually just means moving a colon in the docstring, so
  `name: (type) description` becomes `name (type): description`.

- References to other symbols can be cross-references if they have the right
  format. For example, "attr_name" might become ":attr:`attr_name`".
  https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#cross-referencing-python-objects

- For fenced code blocks, adding a double-colon `::` signifies a literal block.
  https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#literal-blocks

- Some bits of docstrings move from docstring to comments. For TODOs, this
  means we won't be putting stale (or otherwise unrelated) noise into the docs.
  For `Message.DESCRIPTOR`, the change means it gets appropriate documentation.

- There are some wording tweaks for consistency, and some new docstrings
  (especially for methods in Message).

For types, I used the convention of `list[Foo]` and `dict(foo, bar)`, which seem
to be common among other Python rst docstrings. Sphinx should generally
recognize both, and cross-links them correctly (both internally and to Python
library documentation). Upgrading to Python3-style type annotations would allow
us to use `sphinx-autodoc-typehints`; the changes in this commit are very
similar to typing-based hints.
2020-03-10 12:57:30 -07:00
Rafi Kamal
637d7eda30 Project import generated by Copybara
PiperOrigin-RevId: 300117791
2020-03-10 10:08:50 -07:00
David L. Jones
228fbf513d Change dependencies in the Conda environment.
We can remove the dependency on sphinxcontrib, since sphinx.ext.napoleon is
already available. This means we can drop conda-forge, which substantially
reduces build memory usage (see: readthedocs/readthedocs.org#6742,
conda/conda#5003, conda/conda#8650, readthedocs/readthedocs.org#6692).

Bump Sphinx to 2.4.0, while we're at it.
2020-03-09 19:55:33 -07:00
Rafi Kamal
4fa3c8e883 Project import generated by Copybara
PiperOrigin-RevId: 299970447
2020-03-09 17:00:42 -07:00
Falko Axmann
460376190b cmake: extended protobuf_generate
Added an optional `PLUGIN` argument to `protobuf_generate` which
will be forwarded to the `--plugin=` argument of `protoc`.
2020-03-09 15:03:07 -07:00
David L. Jones
f130827371 Don't expect to include Python ReadTheDocs metadata in the distribution. 2020-03-06 17:34:07 -08:00
David L. Jones
619a8262aa Make sure setup.py has a valid path.
In some invocation patterns, `os.path.dirname(__file__)` may not return a valid
value. This change defaults to os.curdir in that case.
2020-03-06 17:34:07 -08:00
Jan Tattermusch
b90d3bd854 add benchmark for measuring raw primitive parsing speed 2020-03-05 12:09:11 +01:00
Yannic Bonenberger
723a85f797 [bazel] Remove bootstrap hack from cc_proto_library and add interop with proto_library
Bazel had a native `cc_proto_library` for more than 2 years now.
This is the first step towards removing that rule from the Protobuf
repo.
2020-03-04 09:25:41 -08:00
Yannic
2e51ad6344
[bazel] Update gtest and deprecate //external:{gtest,gtest_main} (#7237)
This change updates the gtest-version used by Bazel.
Also, `//external:{gtest,gtest_main}` is deprecated so we can remove some
of the uses of the discouraged `bind` function.

RELNOTES[bazel]: Starting with Protobuf 3.13.0, building and running
Protobuf tests requires `@com_google_googletest//:{gtest,gtest_main}`
instead of `//external:{gtest,gtest_main}`. Use
`--@com_google_protobuf//:incompatible_use_com_google_googletest=true`
to verify your workspace is not affected by this change.
2020-03-02 15:15:22 -08:00
Rafi Kamal
398b801355
Merge pull request #7275 from protocolbuffers/rafi-kamal-patch-3
Add bazel to the list of acceptable mergeable tags
2020-03-02 15:11:43 -08:00
Rafi Kamal
37934fe46f
Update mergeable.yml 2020-03-02 15:10:49 -08:00
Rafi Kamal
154788bb4c
Add bazel to the list of acceptable mergeable tags 2020-03-02 13:41:56 -08:00
Rafi Kamal
64f151fa2b Project import generated by Copybara
PiperOrigin-RevId: 298409332
2020-03-02 11:59:44 -08:00
David L. Jones
4ff0fb841c
Merge pull request #7150 from tswast/issue4498-readthedocs
python: publish sphinx docs to read the docs
2020-02-28 20:28:04 -08:00
Tim Swast
35a2bf9d90
python: publish sphinx docs to read the docs
Background:

This is a follow-up to the PR that adds sphinx docs.

Read the Docs is a hosting platform for documentation, primarily Python
docs. It supports builds at commit time as well as at specific git
labels to support versioned docs. I have claimed the
protobuf.readthedocs.io project and can add any Googlers who need access
to be able to configure and trigger builds.
https://readthedocs.org/projects/protobuf/builds/ It's also relatively
easy to create a new project to test the documentation builds from a
fork, such as https://readthedocs.org/projects/tswast-protobuf/builds/

About this change:

Once web hooks are configured, Read the Docs will automatically build
the docs for the latest changes on the master branch.

I needed to update `python/setup.py` to support installation from the
root of the repository because Read the Docs does not `cd python` before
installing the protobuf package with `setup.py install`. To support
this, I updated the file paths to use the absolute path to files. The
`__file__` special variable comes in handy for this, as it provides the
path to the `setup.py` file.

A banner is added to the docs when published to readthedocs. This links
to the official documentation and the future home of the stable API
reference on googleapis.dev.
2020-02-28 13:36:50 -06:00
Daniel Kurka
ed19442270 Project import generated by Copybara
PiperOrigin-RevId: 297743020
2020-02-27 18:55:33 -08:00
Rafi Kamal
9bbc664671 Project import generated by Copybara
PiperOrigin-RevId: 297709554
2020-02-27 15:55:57 -08:00
David L. Jones
42903f87f0
Merge pull request #7154 from tswast/issue4498-googleapis.dev
python: publish sphinx docs to googleapis.dev
2020-02-27 14:30:54 -08:00
David L. Jones
73f3a7209b Fix typo in Makefile.am.
This is a fix for a typo in commit 743a4322ba.

The missing newline continuation causes the re-generated Makefile to yield a parse error.
2020-02-27 11:26:39 -08:00
Protobuf Team
d2727a2ce3 Project import generated by Copybara
PiperOrigin-RevId: 297637283
2020-02-27 10:55:04 -08:00
Artem Kustikov
743a4322ba
Fix js message pivot selection (#6813)
* fix javascript setFieldIgnoringDefault_ logic

* remove package-lock.json

* fix build script to include new UT asset file

Co-authored-by: Daniel Kurka <kurka.daniel@gmail.com>
2020-02-27 09:10:16 -08:00
Mark Schaller
88579a44fb Reserve extension for Bazel failure detail metadata
The Bazel project (https://github.com/bazelbuild/bazel) intends to
enrich its server app's (protobuf-defined) command service's status
message with a structured representation of what, if anything, went
wrong while processing a command. We wish to use custom options to add
metadata to the protobuf constructs involved.

release notes: no
2020-02-25 14:40:36 -08:00
Egor Pugin
c798ba18a9 bug: #7076 adds ERROR to windows portability files 2020-02-21 14:49:18 -08:00
wsw2016
b96241b1b7 Improves performance of json_stream_parser.cc by factor 1000
JsonStreamParser::GetNextTokenType() uses HasPrefixString a lot on StringPiece as input. For each call two std::strings are constructed, compared and destroyed. Parsing of json-files with 50-60 MB in debug mode takes minutes.
2020-02-19 11:33:46 -08:00
Rafi Kamal
1370c7303a
Merge pull request #7231 from protocolbuffers/3.11.x-202002181624
Merge branch 3.11.x to master
2020-02-18 17:39:41 -08:00
Rafi Kamal
0eb476b696 Merge branch 3.11.x to master 2020-02-18 16:42:47 -08:00
Rafi Kamal
df2bce345d
Remove 32-bit Mac protoc reference from collect_all_artifacts (#7228) 2020-02-18 12:55:01 -08:00
Rafi Kamal
147fd0b710
Update Google.Protobuf.Tools.nuspec to remove 32-bit Mac protoc reference (#7227) 2020-02-18 10:23:20 -08:00
Rafi Kamal
1f2d6bf4b5
Remove 32-bit Mac binary from csharp build tools (#7215) 2020-02-14 12:50:45 -08:00
Rafi Kamal
d0bfd52211
Skip building distribution tar files for 32 bit Mac (#7214) 2020-02-14 12:13:20 -08:00
Rafi Kamal
e9e4c687d6
Update CHANGES.txt to include the description of #7210 (#7212) 2020-02-14 10:19:40 -08:00
Jan Tattermusch
0e8f69e532
enforce recursion depth checking for unknown fields (#7210) 2020-02-14 10:17:06 -08:00
rafikamal
83b47e4c65 Project import generated by Copybara
PiperOrigin-RevId: 294283216
2020-02-13 15:48:49 -08:00
rafikamal
becf5afd34 Project import generated by Copybara
PiperOrigin-RevId: 293911829
2020-02-13 15:48:41 -08:00
rafikamal
46b0fd9cec Project import generated by Copybara
PiperOrigin-RevId: 293893031
2020-02-13 15:48:34 -08:00
Rafi Kamal
d314101531
Remove protoc release for 32-bit Macs (#7209)
* Remove protoc release for 32-bit Macs 

Apple has been removing the support for 32-bit Mac apps: https://support.apple.com/en-us/HT208436

Our release infrastructure no longer supports building for 32-bit architecture.

* Remove protoc artifact for MacOS 32-bit
2020-02-13 14:00:19 -08:00
Yannic
f0cb9cdb95
[bazel] Move Java runtime/toolchains into //java (#7190)
* [bazel] Move Java runtime/toolchains into //java

This change moves `java_library` targets from the top-level BUILD file
into `//java/{core,lite,util}` and declares `alias` targets to point to
their new locations (hence, this is not a breaking change).

This will allow users that don't use Java to stop depending on
`@rules_java` (e.g. as requested in
https://github.com/bazelbuild/rules_scala/pull/989#issuecomment-583405161).

Note that there is no intention to deprecate + remove the top-level
targets in the foreseeable future.

* Add BUILD files in //java to java_EXTRA_DIST
2020-02-13 13:04:14 -08:00
Rafi Kamal
7393bf12fa
Update CHANGES.txt for 3.11.4 release (#7205) 2020-02-12 14:41:31 -08:00
Rafi Kamal
c74057267d
Update protobuf version (#7206) 2020-02-12 14:41:16 -08:00
Rafi Kamal
906e9c6897
Fix for JSON serialization of 0/empty-valued wrapper types (#7198) (#7204)
* Fixed Ruby JSON serialization of 0/empty wrapper fields.

* Removed newly-passing conformance tests from the failure list.

Co-authored-by: Joshua Haberman <jhaberman@gmail.com>
2020-02-12 13:27:36 -08:00
Chuck Atkins
10c48c980f Intel compiler: silence noisy warning for incorrectly evaluated inlining 2020-02-12 13:08:59 -08:00
Chuck Atkins
8312c36567 Intel compiler: ifdef out an incorrectly evaluated is_pod type trait 2020-02-12 13:08:59 -08:00
Yannic Bonenberger
06ae5d8042 Use PROTOBUF_RTTI from port_def.inc macro instead of checking for absence of GOOGLE_PROTOBUF_NO_RTTI macro
These were the only 2 remaining occurences of this pattern.
2020-02-12 13:08:25 -08:00
Martin Pärtel
82a057596e Destruct CodedOutputStream instead of using Trim() 2020-02-12 13:06:52 -08:00
Martin Pärtel
f6902d6afe Made protoc --descriptor_set_out deterministic.
Repeatable protoc output is useful because it's sometimes
checked into version control, and rerunning protoc should
not generate unnecessary diffs.
2020-02-12 13:06:52 -08:00
Rafi Kamal
3c020b90a7
Update CHANGES.txt for 3.11.4 release 2020-02-12 12:51:32 -08:00
Rafi Kamal
37fc4327ef
Fix for wrappers with a zero value (#7195) (#7201)
* Add failing tests for issues with wrapped values where the value is the default

* Add test for wrapped values without a value set

* Bugfix for wrapper types with default values.

The previous optimizations for wrapper types had a bug that prevented
wrappers from registering as "present" if the "value" field was not
present on the wire.

In practice the "value" field will not be serialized when it is zero,
according to proto3 semantics, but due to the optimization this
prevented it from creating a new object to represent the presence of the
field.

The fix is to ensure that if the wrapper message is present on the wire,
we always initialize its value to zero.

Co-authored-by: Joshua Haberman <jhaberman@gmail.com>
Co-authored-by: Dan Quan <dan@quan.io>
2020-02-12 12:37:19 -08:00
Rafi Kamal
1440569231
Update the Xcode version number in Kokoro (#7202) (#7203)
Currently all of our MacOS tests are failing with the error: "autom4te: need GNU m4 1.4 or later: /usr/bin/m4". This is likely to be happening because Kokoro has updated their Xcode version to 11.3.
2020-02-12 11:34:51 -08:00
Rafi Kamal
a24e594833
Update the Xcode version number in Kokoro (#7202)
Currently all of our MacOS tests are failing with the error: "autom4te: need GNU m4 1.4 or later: /usr/bin/m4". This is likely to be happening because Kokoro has updated their Xcode version to 11.3.
2020-02-12 11:28:38 -08:00