Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
9b7f6c54
Commit
9b7f6c54
authored
Dec 08, 2010
by
liujisi@google.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issues: 223 224 242.
parent
1fd96c43
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
13 deletions
+43
-13
README.txt
python/README.txt
+24
-0
setup.py
python/setup.py
+18
-12
command_line_interface_unittest.cc
...ogle/protobuf/compiler/command_line_interface_unittest.cc
+1
-1
No files found.
python/README.txt
View file @
9b7f6c54
...
...
@@ -63,6 +63,9 @@ Installation
$ python setup.py install
This step may require superuser privileges.
NOTE: To use C++ implementation, you need to export the environment variable
before this step. See the "C++ Implementation" section below for more
details.
Usage
=====
...
...
@@ -71,3 +74,24 @@ The complete documentation for Protocol Buffers is available via the
web at:
http://code.google.com/apis/protocolbuffers/
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.
To use the C++ implementation, export an environment variable:
$ 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
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.
python/setup.py
View file @
9b7f6c54
...
...
@@ -102,17 +102,22 @@ if __name__ == '__main__':
# Generate necessary .proto file if it doesn't exist.
# TODO(kenton): Maybe we should hook this into a distutils command?
generate_proto
(
"../src/google/protobuf/descriptor.proto"
)
python_c_extension
=
Extension
(
"google.protobuf.internal._net_proto2___python"
,
[
"google/protobuf/pyext/python_descriptor.cc"
,
"google/protobuf/pyext/python_protobuf.cc"
,
"google/protobuf/pyext/python-proto2.cc"
,
],
include_dirs
=
[
"../src"
,
"."
,
],
libraries
=
[
"protobuf"
],
runtime_library_dirs
=
[
"../src/.libs"
],
library_dirs
=
[
"../src/.libs"
],
)
generate_proto
(
"../src/google/protobuf/compiler/plugin.proto"
)
ext_module_list
=
[]
# C++ implementation extension
if
os
.
getenv
(
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION"
,
"python"
)
==
"cpp"
:
print
"Using EXPERIMENTAL C++ Implmenetation."
ext_module_list
.
append
(
Extension
(
"google.protobuf.internal._net_proto2___python"
,
[
"google/protobuf/pyext/python_descriptor.cc"
,
"google/protobuf/pyext/python_protobuf.cc"
,
"google/protobuf/pyext/python-proto2.cc"
],
include_dirs
=
[
"../src"
,
"."
,
],
libraries
=
[
"protobuf"
],
runtime_library_dirs
=
[
"../src/.libs"
],
library_dirs
=
[
"../src/.libs"
]))
setup
(
name
=
'protobuf'
,
version
=
'2.4.0-pre'
,
...
...
@@ -132,12 +137,13 @@ if __name__ == '__main__':
'google.protobuf.internal.wire_format'
,
'google.protobuf.descriptor'
,
'google.protobuf.descriptor_pb2'
,
'google.protobuf.compiler.plugin_pb2'
,
'google.protobuf.message'
,
'google.protobuf.reflection'
,
'google.protobuf.service'
,
'google.protobuf.service_reflection'
,
'google.protobuf.text_format'
],
ext_modules
=
[
python_c_extension
]
,
ext_modules
=
ext_module_list
,
url
=
'http://code.google.com/p/protobuf/'
,
maintainer
=
maintainer_email
,
maintainer_email
=
'protobuf@googlegroups.com'
,
...
...
src/google/protobuf/compiler/command_line_interface_unittest.cc
View file @
9b7f6c54
...
...
@@ -566,7 +566,7 @@ TEST_F(CommandLineInterfaceTest, Insert) {
"foo.proto"
,
"Foo"
);
}
#if defined(_WIN32)
|| defined(__CYGWIN__)
#if defined(_WIN32)
TEST_F
(
CommandLineInterfaceTest
,
WindowsOutputPath
)
{
// Test that the output path can be a Windows-style path.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment