diff options
author | Jisi Liu <jisi.liu@gmail.com> | 2015-03-04 16:45:13 -0800 |
---|---|---|
committer | Jisi Liu <jisi.liu@gmail.com> | 2015-03-04 16:45:13 -0800 |
commit | 4573e110b89d3b1288f2f9f611fc85b91256db3a (patch) | |
tree | 8391742471324566d3e454b6911c819bf18a1cc6 /python | |
parent | e4a9ace5415477feaefd70a2af2d0e93e83213a3 (diff) |
Fix python versions to comply with pep-0440.
Change-Id: Ifb4958e4f371b36f249faa466473f851697edb5c
Diffstat (limited to 'python')
-rwxr-xr-x | python/google/protobuf/__init__.py | 2 | ||||
-rwxr-xr-x | python/setup.py | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/python/google/protobuf/__init__.py b/python/google/protobuf/__init__.py index ef8c9c58..1345bd5f 100755 --- a/python/google/protobuf/__init__.py +++ b/python/google/protobuf/__init__.py @@ -32,4 +32,4 @@ # # Copyright 2007 Google Inc. All Rights Reserved. -__version__ = '3.0.0-alpha-3-pre' +__version__ = '3.0.0a3.dev0' diff --git a/python/setup.py b/python/setup.py index b97fdaea..c18818e2 100755 --- a/python/setup.py +++ b/python/setup.py @@ -44,6 +44,18 @@ elif os.path.exists("../vsprojects/Release/protoc.exe"): else: protoc = find_executable("protoc") +def GetVersion(): + """Gets the version from google/protobuf/__init__.py + + Do not import google.protobuf.__init__ directly, because an installed protobuf + library may be loaded instead. + + """ + with open(os.path.join('google', 'protobuf', '__init__.py')) as version_file: + exec(version_file.read()) + return __version__ + + def generate_proto(source): """Invokes the Protocol Compiler to generate a _pb2.py from the given .proto file. Does nothing if the output already exists and is newer than @@ -150,7 +162,7 @@ if __name__ == '__main__': os.environ['PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION'] = 'cpp' setup(name = 'protobuf', - version = '3.0.0-alpha-3-pre', + version = GetVersion(), packages = [ 'google' ], namespace_packages = [ 'google' ], google_test_dir = "google/protobuf/internal", |