Path: blob/main/tools/build_config/buildWindowsSUMOWheel.py
169674 views
#!/usr/bin/env python1# -*- coding: utf-8 -*-2# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo3# Copyright (C) 2008-2025 German Aerospace Center (DLR) and others.4# This program and the accompanying materials are made available under the5# terms of the Eclipse Public License 2.0 which is available at6# https://www.eclipse.org/legal/epl-2.0/7# This Source Code may also be made available under the following Secondary8# Licenses when the conditions for such availability set forth in the Eclipse9# Public License 2.0 are satisfied: GNU General Public License, version 210# or later which is available at11# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html12# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later1314# @file buildWindowsSUMOWheel.py15# @author Michael Behrisch16# @date 2024-03-071718import glob19import logging20import os21import shutil22import sys23from os.path import join, dirname2425import status26import version272829def main():30logger = logging.getLogger()31logger.setLevel(logging.INFO)32SUMO_HOME = os.environ.get("SUMO_HOME", dirname(dirname(dirname(os.path.abspath(__file__)))))33BUILD_CONFIG = join(SUMO_HOME, "tools", "build_config")34shutil.copy(join(SUMO_HOME, "build_config", "pyproject.toml"), SUMO_HOME)35version.filter_setup_py(join(BUILD_CONFIG, "setup-sumo.py"), join(SUMO_HOME, "setup.py"))36status.log_subprocess([sys.executable, "-m", "build", "--wheel", "--config-setting=-G=Ninja"], cwd=SUMO_HOME)37f = glob.glob(join(SUMO_HOME, "dist", "eclipse_sumo-*"))[0]38os.rename(f, f.replace("cp3%s-cp3%s" % (sys.version_info.minor, sys.version_info.minor), "py2.py3-none"))394041if __name__ == "__main__":42main()434445