Skip to content

Commit

Permalink
adapting github actions to new build/install pipeline for python modu…
Browse files Browse the repository at this point in the history
…les #12005
  • Loading branch information
behrisch committed Feb 18, 2023
1 parent 21e35fe commit 98504c0
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 13 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/wheel-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ jobs:
- name: Building helper wheels for later tests
run: |
cd tools
python build/setup-sumolib.py bdist_wheel
python build/setup-traci.py bdist_wheel
python build/version.py build/setup-sumolib.py ./setup.py
python -m build --sdist --wheel
python build/version.py build/setup-traci.py ./setup.py
python -m build --sdist --wheel
- name: Uploading artifacts (Helper wheels)
uses: actions/upload-artifact@v3
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/mirror
/share
/dist
/setup.py
# IDE project files
/.settings
/.cproject
Expand Down Expand Up @@ -115,6 +116,7 @@
/tools/libsumo/libsumo.py
/tools/libtraci/_libtraci.*
/tools/libtraci/libtraci.py
/tools/setup.py
# extracted tests
/tests/_*
# netedit test
Expand Down
7 changes: 7 additions & 0 deletions build/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[build-system]
requires = [ "setuptools>=42",
"scikit-build>=0.13",
"cmake>=3.18",
"ninja",
]
build-backend = "setuptools.build_meta"
22 changes: 13 additions & 9 deletions tools/build/build_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,27 @@ if test -z $HTTPS_PROXY; then
yum install -y --nogpgcheck ccache libxerces-c-devel proj-devel fox16-devel bzip2-devel gl2ps-devel swig3
pipx install -f patchelf==0.16.1.0 # see https://github.com/pypa/manylinux/issues/1421
fi
/opt/python/cp38-cp38/bin/pip install scikit-build cmake

mkdir -p $HOME/.ccache
echo "hash_dir = false" >> $HOME/.ccache/ccache.conf
echo "base_dir = /github/workspace/_skbuild/linux-x86_64-3.8" >> $HOME/.ccache/ccache.conf
/opt/python/cp38-cp38/bin/python tools/build/setup-sumo.py -j 8 bdist_wheel
cp build/pyproject.toml .
py=/opt/python/cp38-cp38
$py/bin/python tools/build/version.py tools/build/setup-sumo.py ./setup.py
$py/bin/python -m build --wheel
mv dist/eclipse_sumo-* `echo dist/eclipse_sumo-* | sed 's/cp38-cp38/py2.py3-none/'`
auditwheel repair dist/eclipse_sumo*.whl
cp -a data tools/libsumo
for py in /opt/python/cp3[1789]*; do
rm dist/*.whl
$py/bin/pip install scikit-build
rm tools/dist/*.whl
pminor=`echo $py | sed 's,/opt/python/cp3,,;s/-.*//'`
echo "base_dir = /github/workspace/_skbuild/linux-x86_64-3.${pminor}" >> $HOME/.ccache/ccache.conf
$py/bin/python tools/build/setup-sumo.py -j 8 bdist_wheel
$py/bin/python tools/build/setup-libsumo.py bdist_wheel
$py/bin/python tools/build/setup-libtraci.py bdist_wheel
auditwheel repair dist/libsumo*.whl
auditwheel repair dist/libtraci*.whl
$py/bin/python tools/build/version.py tools/build/setup-sumo.py ./setup.py
$py/bin/python -m build --wheel
$py/bin/python tools/build/version.py tools/build/setup-libsumo.py tools/setup.py
$py/bin/python -m build --wheel tools
$py/bin/python tools/build/version.py tools/build/setup-libtraci.py tools/setup.py
$py/bin/python -m build --wheel tools
auditwheel repair tools/dist/libsumo*.whl
auditwheel repair tools/dist/libtraci*.whl
done
6 changes: 4 additions & 2 deletions tools/build/setup-sumo.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
import version

SUMO_VERSION = version.get_pep440_version()
package_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sumo_dir = os.path.abspath(os.path.dirname(__file__))
while not os.path.exists(os.path.join(sumo_dir, 'README.md')) and sumo_dir != os.path.dirname(sumo_dir):
sumo_dir = os.path.dirname(sumo_dir)

setup(
name='eclipse-sumo',
Expand All @@ -31,7 +33,7 @@
author_email='[email protected]',
license='EPL-2.0',
description=("A microscopic, multi-modal traffic simulation package"),
long_description=open(os.path.join(os.path.dirname(package_dir), 'README.md')).read(),
long_description=open(os.path.join(sumo_dir, 'README.md')).read(),
long_description_content_type='text/markdown',

classifiers=[
Expand Down

0 comments on commit 98504c0

Please sign in to comment.