Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 53 additions & 30 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
#! python
# -*- coding: UTF-8 -*-

from setuptools import setup
from setuptools.command.install import install
import subprocess
import os
import subprocess
import sys
from distutils.spawn import find_executable

from setuptools import setup
from setuptools.command.install import install

package_name = 'osi'
package_path = os.path.join(os.getcwd(), package_name)


class GenerateProtobuf(install):

@staticmethod
def find_protoc():
"""Locates protoc executable"""
Expand All @@ -23,22 +25,40 @@ def find_protoc():
protoc = find_executable('protoc')

if protoc is None:
sys.stderr.write('protoc not found. Is protobuf-compiler installed? \n'
'Alternatively, you can point the PROTOC environment variable at a local version.')
sys.stderr.write(
'protoc not found. Is protobuf-compiler installed? \n'
'Alternatively, you can point the PROTOC environment variable'
'at a local version.')
sys.exit(1)
return protoc

osi_files = ('osi_common.proto', 'osi_datarecording.proto', 'osi_detectedlandmark.proto',
'osi_detectedobject.proto', 'osi_detectedoccupant.proto', 'osi_detectedlane.proto',
'osi_environment.proto', 'osi_groundtruth.proto', 'osi_landmark.proto', 'osi_lowleveldata.proto',
'osi_modelinternal.proto', 'osi_object.proto', 'osi_occupant.proto', 'osi_lane.proto',
'osi_sensordata.proto', 'osi_sensorspecific.proto')
osi_files = (
'osi_common.proto',
'osi_datarecording.proto',
'osi_detectedlandmark.proto',
'osi_detectedobject.proto',
'osi_detectedoccupant.proto',
'osi_detectedlane.proto',
'osi_environment.proto',
'osi_groundtruth.proto',
'osi_landmark.proto',
'osi_lowleveldata.proto',
'osi_modelinternal.proto',
'osi_object.proto',
'osi_occupant.proto',
'osi_lane.proto',
'osi_sensordata.proto',
'osi_sensorspecific.proto')

""" Generate Protobuf Messages """

def run(self):
for source in self.osi_files:
sys.stdout.write('Protobuf-compiling ' + source + '\n')
subprocess.check_call([self.find_protoc(), '--proto_path=.', '--python_out='+package_path, './' + source])
subprocess.check_call([self.find_protoc(),
'--proto_path=.',
'--python_out=' + package_path,
'./' + source])

install.run(self)

Expand All @@ -52,23 +72,26 @@ def run(self):
except Exception:
pass

setup(name='open-simulation-interface',
version='2.0.0',
description='A generic interface for the environmental perception of automated driving functions in virtual '
'scenarios.',
author='Carlo van Driesten, Timo Hanke, Nils Hirsenkorn, Pilar Garcia-Ramos, Mark Schiementz, '
'Sebastian Schneider',
author_email='Carlo.van-Driesten@bmw.de, Timo.Hanke@bmw.de, Nils.Hirsenkorn@tum.de, Pilar.Garcia-Ramos@bmw.de,'
'Mark.Schiementz@bmw.de, Sebastian.SB.Schneider@bmw.de',
packages=[package_name],
install_requires=['protobuf'],
cmdclass={
setup(
name='open-simulation-interface',
version='2.0.0',
description='A generic interface for the environmental perception of'
'automated driving functions in virtual scenarios.',
author='Carlo van Driesten, Timo Hanke, Nils Hirsenkorn,'
'Pilar Garcia-Ramos, Mark Schiementz, Sebastian Schneider',
author_email='Carlo.van-Driesten@bmw.de, Timo.Hanke@bmw.de,'
'Nils.Hirsenkorn@tum.de, Pilar.Garcia-Ramos@bmw.de,'
'Mark.Schiementz@bmw.de, Sebastian.SB.Schneider@bmw.de',
packages=[package_name],
install_requires=['protobuf'],
cmdclass={
'install': GenerateProtobuf,
},
url='https://github.com/OpenSimulationInterface/open-simulation-interface',
license="MPL 2.0",
classifiers=[
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
],
data_files=[("", ["LICENSE"])]
)
},
url='https://github.com/OpenSimulationInterface/open-simulation-interface',
license="MPL 2.0",
classifiers=[
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
],
data_files=[
("",
["LICENSE"])])