Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/tools/build_config/setup-libtraci.py
169674 views
1
#!/usr/bin/env python
2
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
# Copyright (C) 2017-2025 German Aerospace Center (DLR) and others.
4
# This program and the accompanying materials are made available under the
5
# terms of the Eclipse Public License 2.0 which is available at
6
# https://www.eclipse.org/legal/epl-2.0/
7
# This Source Code may also be made available under the following Secondary
8
# Licenses when the conditions for such availability set forth in the Eclipse
9
# Public License 2.0 are satisfied: GNU General Public License, version 2
10
# or later which is available at
11
# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13
14
# @file setup-libtraci.py
15
# @author Benjamin Striner
16
# @author Michael Behrisch
17
# @date 2017-01-26
18
19
20
from setuptools import setup
21
from setuptools.dist import Distribution
22
from setuptools.command.install import install
23
import os
24
import glob
25
26
import version
27
28
SUMO_VERSION = version.get_pep440_version()
29
package_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
30
31
32
class InstallPlatlib(install):
33
def finalize_options(self):
34
install.finalize_options(self)
35
if self.distribution.has_ext_modules():
36
self.install_lib = self.install_platlib
37
38
39
class BinaryDistribution(Distribution):
40
"""Distribution which always forces a binary package with platform name"""
41
42
def has_ext_modules(self):
43
return True
44
45
46
setup(
47
name='libtraci',
48
version=SUMO_VERSION,
49
url='https://sumo.dlr.de/docs/TraCI.html',
50
author='DLR and contributors',
51
author_email='[email protected]',
52
license='EPL-2.0',
53
description="The python version of the libtraci API to communicate with the traffic simulation Eclipse SUMO",
54
long_description=open(os.path.join(os.path.dirname(package_dir), 'README.md')).read(),
55
long_description_content_type='text/markdown',
56
57
classifiers=[
58
'Development Status :: 4 - Beta',
59
'Intended Audience :: Developers',
60
'Intended Audience :: Science/Research',
61
'Programming Language :: Python :: 3',
62
],
63
keywords='traffic simulation traci sumo',
64
65
packages=['libtraci'],
66
package_dir={'': package_dir},
67
package_data={'libtraci': ['*.pyd', '*.so', '*.dylib']},
68
data_files=[("", glob.glob(os.path.join(os.path.dirname(package_dir), 'bin', '*.dll')))],
69
install_requires=['traci>='+SUMO_VERSION],
70
cmdclass={'install': InstallPlatlib},
71
distclass=BinaryDistribution
72
)
73
74