Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/tools/build_config/buildWindowsSUMOWheel.py
169674 views
1
#!/usr/bin/env python
2
# -*- coding: utf-8 -*-
3
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
4
# Copyright (C) 2008-2025 German Aerospace Center (DLR) and others.
5
# This program and the accompanying materials are made available under the
6
# terms of the Eclipse Public License 2.0 which is available at
7
# https://www.eclipse.org/legal/epl-2.0/
8
# This Source Code may also be made available under the following Secondary
9
# Licenses when the conditions for such availability set forth in the Eclipse
10
# Public License 2.0 are satisfied: GNU General Public License, version 2
11
# or later which is available at
12
# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
13
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
14
15
# @file buildWindowsSUMOWheel.py
16
# @author Michael Behrisch
17
# @date 2024-03-07
18
19
import glob
20
import logging
21
import os
22
import shutil
23
import sys
24
from os.path import join, dirname
25
26
import status
27
import version
28
29
30
def main():
31
logger = logging.getLogger()
32
logger.setLevel(logging.INFO)
33
SUMO_HOME = os.environ.get("SUMO_HOME", dirname(dirname(dirname(os.path.abspath(__file__)))))
34
BUILD_CONFIG = join(SUMO_HOME, "tools", "build_config")
35
shutil.copy(join(SUMO_HOME, "build_config", "pyproject.toml"), SUMO_HOME)
36
version.filter_setup_py(join(BUILD_CONFIG, "setup-sumo.py"), join(SUMO_HOME, "setup.py"))
37
status.log_subprocess([sys.executable, "-m", "build", "--wheel", "--config-setting=-G=Ninja"], cwd=SUMO_HOME)
38
f = glob.glob(join(SUMO_HOME, "dist", "eclipse_sumo-*"))[0]
39
os.rename(f, f.replace("cp3%s-cp3%s" % (sys.version_info.minor, sys.version_info.minor), "py2.py3-none"))
40
41
42
if __name__ == "__main__":
43
main()
44
45