Index: third_party/protobuf/python/README.md |
diff --git a/third_party/protobuf/python/README.txt b/third_party/protobuf/python/README.md |
similarity index 58% |
rename from third_party/protobuf/python/README.txt |
rename to third_party/protobuf/python/README.md |
index 6dc144e9b817c50bab9e59a1c25b408a3e955c16..1b5b9dffd9a1ad209293b428197cbfad31269597 100644 |
--- a/third_party/protobuf/python/README.txt |
+++ b/third_party/protobuf/python/README.md |
@@ -1,4 +1,8 @@ |
Protocol Buffers - Google's data interchange format |
+=================================================== |
+ |
+[![Build Status](https://travis-ci.org/google/protobuf.svg?branch=master)](https://travis-ci.org/google/protobuf) |
+ |
Copyright 2008 Google Inc. |
This directory contains the Python Protocol Buffers runtime library. |
@@ -6,7 +10,7 @@ This directory contains the Python Protocol Buffers runtime library. |
Normally, this directory comes as part of the protobuf package, available |
from: |
- http://code.google.com/p/protobuf |
+ https://developers.google.com/protocol-buffers/ |
The complete package includes the C++ source code, which includes the |
Protocol Compiler (protoc). If you downloaded this package from PyPI |
@@ -26,7 +30,7 @@ join the Protocol Buffers discussion list and let us know! |
Installation |
============ |
-1) Make sure you have Python 2.4 or newer. If in doubt, run: |
+1) Make sure you have Python 2.6 or newer. If in doubt, run: |
$ python -V |
@@ -35,7 +39,7 @@ Installation |
If you would rather install it manually, you may do so by following |
the instructions on this page: |
- http://peak.telecommunity.com/DevCenter/EasyInstall#installation-instructions |
+ https://packaging.python.org/en/latest/installing.html#setup-for-installing-packages |
3) Build the C++ code, or install a binary distribution of protoc. If |
you install a binary distribution, make sure that it is the same |
@@ -43,10 +47,43 @@ Installation |
$ protoc --version |
-4) Run the tests: |
+4) Build and run the tests: |
+ $ python setup.py build |
$ python setup.py test |
+ To build, test, and use the C++ implementation, you must first compile |
+ libprotobuf.so: |
+ |
+ $ (cd .. && make) |
+ |
+ On OS X: |
+ |
+ If you are running a homebrew-provided python, you must make sure another |
+ version of protobuf is not already installed, as homebrew's python will |
+ search /usr/local/lib for libprotobuf.so before it searches ../src/.libs |
+ You can either unlink homebrew's protobuf or install the libprotobuf you |
+ built earlier: |
+ |
+ $ brew unlink protobuf |
+ or |
+ $ (cd .. && make install) |
+ |
+ On other *nix: |
+ |
+ You must make libprotobuf.so dynamically available. You can either |
+ install libprotobuf you built earlier, or set LD_LIBRARY_PATH: |
+ |
+ $ export LD_LIBRARY_PATH=../src/.libs |
+ or |
+ $ (cd .. && make install) |
+ |
+ To build the C++ implementation run: |
+ $ python setup.py build --cpp_implementation |
+ |
+ Then run the tests like so: |
+ $ python setup.py test --cpp_implementation |
+ |
If some tests fail, this library may not work correctly on your |
system. Continue at your own risk. |
@@ -60,12 +97,17 @@ Installation |
5) Install: |
- $ python setup.py install |
+ $ python setup.py install |
+ |
+ or: |
+ |
+ $ (cd .. && make install) |
+ $ python setup.py install --cpp_implementation |
This step may require superuser privileges. |
- NOTE: To use C++ implementation, you need to install C++ protobuf runtime |
- library of the same version and export the environment variable before this |
- step. See the "C++ Implementation" section below for more details. |
+ NOTE: To use C++ implementation, you need to export an environment |
+ variable before running your program. See the "C++ Implementation" |
+ section below for more details. |
Usage |
===== |
@@ -73,13 +115,11 @@ Usage |
The complete documentation for Protocol Buffers is available via the |
web at: |
- http://code.google.com/apis/protocolbuffers/ |
+ https://developers.google.com/protocol-buffers/ |
C++ Implementation |
================== |
-WARNING: This is EXPERIMENTAL and only available for CPython platforms. |
- |
The C++ implementation for Python messages is built as a Python extension to |
improve the overall protobuf Python performance. |
@@ -88,13 +128,8 @@ To use the C++ implementation, you need to: |
parent directory. |
2) Export an environment variable: |
- $ export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp |
+ $ export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp |
-You need to export this variable before running setup.py script to build and |
-install the extension. You must also set the variable at runtime, otherwise |
+You must set this variable at runtime, before running your program, otherwise |
the pure-Python implementation will be used. In a future release, we will |
change the default so that C++ implementation is used whenever it is available. |
-It is strongly recommended to run `python setup.py test` after setting the |
-variable to "cpp", so the tests will be against C++ implemented Python |
-messages. |
- |