99from setuptools import setup
1010from setuptools .command .install import install
1111
12+ # configure the version number
13+ from shutil import copyfile
14+ copyfile ('VERSION' , 'version.py' )
15+ from version import *
16+ with open ("osi_version.proto.in" , "rt" ) as fin :
17+ with open ("osi_version.proto" , "wt" ) as fout :
18+ for line in fin :
19+ lineConfigured = line .replace ('@VERSION_MAJOR@' ,str (VERSION_MAJOR ))
20+ lineConfigured = lineConfigured .replace ('@VERSION_MINOR@' ,str (VERSION_MINOR ))
21+ lineConfigured = lineConfigured .replace ('@VERSION_PATCH@' ,str (VERSION_PATCH ))
22+ fout .write (lineConfigured )
23+
1224package_name = 'osi'
1325package_path = os .path .join (os .getcwd (), package_name )
1426
15-
1627class GenerateProtobuf (install ):
1728
1829 @staticmethod
@@ -33,6 +44,7 @@ def find_protoc():
3344 return protoc
3445
3546 osi_files = (
47+ 'osi_version.proto' ,
3648 'osi_common.proto' ,
3749 'osi_datarecording.proto' ,
3850 'osi_detectedlandmark.proto' ,
@@ -74,7 +86,7 @@ def run(self):
7486
7587setup (
7688 name = 'open-simulation-interface' ,
77- version = '2.1.1' ,
89+ version = str ( VERSION_MAJOR ) + '.' + str ( VERSION_MINOR ) + '.' + str ( VERSION_PATCH ) ,
7890 description = 'A generic interface for the environmental perception of'
7991 'automated driving functions in virtual scenarios.' ,
8092 author = 'Carlo van Driesten, Timo Hanke, Nils Hirsenkorn,'
0 commit comments