Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/tools/build_config/setup-libsumo.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-libsumo.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
25
import version
26
27
SUMO_VERSION = version.get_pep440_version()
28
package_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
29
30
31
class InstallPlatlib(install):
32
def finalize_options(self):
33
install.finalize_options(self)
34
if self.distribution.has_ext_modules():
35
self.install_lib = self.install_platlib
36
37
38
class BinaryDistribution(Distribution):
39
"""Distribution which always forces a binary package with platform name"""
40
41
def has_ext_modules(self):
42
return True
43
44
45
setup(
46
name='libsumo',
47
version=SUMO_VERSION,
48
url='https://sumo.dlr.de/docs/Libsumo.html',
49
author='DLR and contributors',
50
author_email='[email protected]',
51
license='EPL-2.0',
52
description="The python version of the libsumo API to communicate with the traffic simulation Eclipse SUMO",
53
long_description=open(os.path.join(os.path.dirname(package_dir), 'README.md')).read(),
54
long_description_content_type='text/markdown',
55
56
classifiers=[
57
'Development Status :: 4 - Beta',
58
'Intended Audience :: Developers',
59
'Intended Audience :: Science/Research',
60
'Programming Language :: Python :: 3',
61
],
62
keywords='traffic simulation traci sumo',
63
64
packages=['libsumo'],
65
package_dir={'': package_dir},
66
package_data={'libsumo': ['*.pyd', '*.so', '*.dylib']},
67
install_requires=['traci>='+SUMO_VERSION, 'eclipse-sumo'],
68
cmdclass={'install': InstallPlatlib},
69
distclass=BinaryDistribution
70
)
71
72