11#! python
22# -*- coding: UTF-8 -*-
33
4- from setuptools import setup
5- from setuptools .command .install import install
6- import subprocess
74import os
5+ import subprocess
86import sys
97from distutils .spawn import find_executable
108
9+ from setuptools import setup
10+ from setuptools .command .install import install
11+
1112package_name = 'osi'
1213package_path = os .path .join (os .getcwd (), package_name )
1314
1415
1516class GenerateProtobuf (install ):
17+
1618 @staticmethod
1719 def find_protoc ():
1820 """Locates protoc executable"""
@@ -23,22 +25,40 @@ def find_protoc():
2325 protoc = find_executable ('protoc' )
2426
2527 if protoc is None :
26- sys .stderr .write ('protoc not found. Is protobuf-compiler installed? \n '
27- 'Alternatively, you can point the PROTOC environment variable at a local version.' )
28+ sys .stderr .write (
29+ 'protoc not found. Is protobuf-compiler installed? \n '
30+ 'Alternatively, you can point the PROTOC environment variable'
31+ 'at a local version.' )
2832 sys .exit (1 )
2933 return protoc
3034
31- osi_files = ('osi_common.proto' , 'osi_datarecording.proto' , 'osi_detectedlandmark.proto' ,
32- 'osi_detectedobject.proto' , 'osi_detectedoccupant.proto' , 'osi_detectedlane.proto' ,
33- 'osi_environment.proto' , 'osi_groundtruth.proto' , 'osi_landmark.proto' , 'osi_lowleveldata.proto' ,
34- 'osi_modelinternal.proto' , 'osi_object.proto' , 'osi_occupant.proto' , 'osi_lane.proto' ,
35- 'osi_sensordata.proto' , 'osi_sensorspecific.proto' )
35+ osi_files = (
36+ 'osi_common.proto' ,
37+ 'osi_datarecording.proto' ,
38+ 'osi_detectedlandmark.proto' ,
39+ 'osi_detectedobject.proto' ,
40+ 'osi_detectedoccupant.proto' ,
41+ 'osi_detectedlane.proto' ,
42+ 'osi_environment.proto' ,
43+ 'osi_groundtruth.proto' ,
44+ 'osi_landmark.proto' ,
45+ 'osi_lowleveldata.proto' ,
46+ 'osi_modelinternal.proto' ,
47+ 'osi_object.proto' ,
48+ 'osi_occupant.proto' ,
49+ 'osi_lane.proto' ,
50+ 'osi_sensordata.proto' ,
51+ 'osi_sensorspecific.proto' )
3652
3753 """ Generate Protobuf Messages """
54+
3855 def run (self ):
3956 for source in self .osi_files :
4057 sys .stdout .write ('Protobuf-compiling ' + source + '\n ' )
41- subprocess .check_call ([self .find_protoc (), '--proto_path=.' , '--python_out=' + package_path , './' + source ])
58+ subprocess .check_call ([self .find_protoc (),
59+ '--proto_path=.' ,
60+ '--python_out=' + package_path ,
61+ './' + source ])
4262
4363 install .run (self )
4464
@@ -52,23 +72,26 @@ def run(self):
5272except Exception :
5373 pass
5474
55- setup (name = 'open-simulation-interface' ,
56- version = '2.0.0' ,
57- description = 'A generic interface for the environmental perception of automated driving functions in virtual '
58- 'scenarios.' ,
59- author = 'Carlo van Driesten, Timo Hanke, Nils Hirsenkorn, Pilar Garcia-Ramos, Mark Schiementz, '
60- 'Sebastian Schneider' ,
61- author_email = 'Carlo.van-Driesten@bmw.de, Timo.Hanke@bmw.de, Nils.Hirsenkorn@tum.de, Pilar.Garcia-Ramos@bmw.de,'
62- 'Mark.Schiementz@bmw.de, Sebastian.SB.Schneider@bmw.de' ,
63- packages = [package_name ],
64- install_requires = ['protobuf' ],
65- cmdclass = {
75+ setup (
76+ name = 'open-simulation-interface' ,
77+ version = '2.0.0' ,
78+ description = 'A generic interface for the environmental perception of'
79+ 'automated driving functions in virtual scenarios.' ,
80+ author = 'Carlo van Driesten, Timo Hanke, Nils Hirsenkorn,'
81+ 'Pilar Garcia-Ramos, Mark Schiementz, Sebastian Schneider' ,
82+ author_email = 'Carlo.van-Driesten@bmw.de, Timo.Hanke@bmw.de,'
83+ 'Nils.Hirsenkorn@tum.de, Pilar.Garcia-Ramos@bmw.de,'
84+ 'Mark.Schiementz@bmw.de, Sebastian.SB.Schneider@bmw.de' ,
85+ packages = [package_name ],
86+ install_requires = ['protobuf' ],
87+ cmdclass = {
6688 'install' : GenerateProtobuf ,
67- },
68- url = 'https://github.com/OpenSimulationInterface/open-simulation-interface' ,
69- license = "MPL 2.0" ,
70- classifiers = [
71- 'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)' ,
72- ],
73- data_files = [("" , ["LICENSE" ])]
74- )
89+ },
90+ url = 'https://github.com/OpenSimulationInterface/open-simulation-interface' ,
91+ license = "MPL 2.0" ,
92+ classifiers = [
93+ 'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)' ,
94+ ],
95+ data_files = [
96+ ("" ,
97+ ["LICENSE" ])])
0 commit comments