File tree Expand file tree Collapse file tree 3 files changed +25
-2
lines changed
Expand file tree Collapse file tree 3 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 2020from .message import Message
2121from .modules import define_module as module
2222from .primitives import ProtoType
23+ from .version import __version__
2324
2425
2526DOUBLE = ProtoType .DOUBLE
4243
4344
4445__all__ = (
46+ "__version__" ,
4547 "Enum" ,
4648 "Field" ,
4749 "MapField" ,
Original file line number Diff line number Diff line change 1+ # Copyright 2023 Google LLC
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+ #
15+ __version__ = "1.22.3"
Original file line number Diff line number Diff line change 1313# limitations under the License.
1414
1515import io
16+ import re
1617import os
1718
1819from setuptools import find_packages , setup
1920
20- version = "1.22.3"
21-
2221PACKAGE_ROOT = os .path .abspath (os .path .dirname (__file__ ))
2322
23+ version = None
24+
25+ with open (os .path .join (PACKAGE_ROOT , "proto/version.py" )) as fp :
26+ version_candidates = re .findall (r"(?<=\")\d+.\d+.\d+(?=\")" , fp .read ())
27+ assert len (version_candidates ) == 1
28+ version = version_candidates [0 ]
29+
2430with io .open (os .path .join (PACKAGE_ROOT , "README.rst" )) as file_obj :
2531 README = file_obj .read ()
2632
You can’t perform that action at this time.
0 commit comments