Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/tools/build_config/wheels.sh
169674 views
1
#!/bin/bash
2
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
# Copyright (C) 2008-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 wheels.sh
15
# @author Michael Behrisch
16
# @date 2024-06-13
17
18
# Does the nightly git pull on the Linux / macOS server and then runs the wheel build
19
PREFIX=$1
20
PLATFORM=$2
21
LOG=$PREFIX/wheel.log
22
# to make sure we do not use the brew python
23
PYTHON=/usr/bin/python3
24
25
cd $PREFIX/sumo
26
git clean -f -x -d -q . &> $LOG ||(echo "git clean failed"; tail -10 $LOG)
27
git pull >> $LOG 2>&1 || (echo "git pull failed"; tail -10 $LOG)
28
rm -rf dist dist_native $LOG
29
if test "$3" == "local"; then
30
cp build_config/pyproject.toml .
31
$PYTHON ./tools/build_config/version.py tools/build_config/setup-sumo.py ./setup.py
32
$PYTHON -m build --wheel >> $LOG 2>&1
33
$PYTHON ./tools/build_config/version.py tools/build_config/setup-libsumo.py tools/setup.py
34
$PYTHON -m build --wheel tools -o dist >> $LOG 2>&1
35
$PYTHON -c 'import os,sys; v="cp%s%s"%sys.version_info[:2]; os.rename(sys.argv[1], sys.argv[1].replace("%s-%s"%(v,v), "py2.py3-none"))' dist/eclipse_sumo-*
36
pushd tools >> $LOG
37
$PYTHON ./build_config/version.py ./build_config/setup-sumolib.py ./setup.py
38
$PYTHON -m build --wheel . -o ../dist >> $LOG 2>&1
39
$PYTHON ./build_config/version.py ./build_config/setup-traci.py ./setup.py
40
$PYTHON -m build --wheel . -o ../dist >> $LOG 2>&1
41
popd >> $LOG
42
mv dist dist_native # just as backup
43
fi
44
# the docker script will create _skbuild, dist and wheelhouse dir owned by root but writable for everyone
45
# we only need wheelhouse, the rest is for inspecting if errors occur
46
docker run --rm -v $PWD:/opt/sumo --workdir /opt/sumo $PLATFORM tools/build_config/build_wheels.sh $HTTPS_PROXY v1.3.1 >> $LOG 2>&1
47
48