Skip to content

Commit

Permalink
Python wheels (#113)
Browse files Browse the repository at this point in the history
* Updated map to 2.5.0
* Added python wheels build
* Removed static linking on general python build and remove the
additional not required module shared library
* Remove outdated and complicated plain cmake handling from docu
* Updated version number to 4.5.0
  • Loading branch information
berndgassmann committed Sep 6, 2021
1 parent ee0136e commit 2ce3bc8
Show file tree
Hide file tree
Showing 30 changed files with 1,264 additions and 1,218 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/build_test.yml
Expand Up @@ -8,7 +8,7 @@ on:

env:
GTEST_OUTPUT: "xml:test_results"
BUILDCMD: "colcon build --event-handlers console_direct+ --executor sequential --packages-up-to ad_rss ad_rss_map_integration --cmake-args -DBUILD_HARDENING=ON -DBUILD_TESTING=ON -DBUILD_PYTHON_BINDING=ON && colcon test --event-handlers console_direct+ --packages-select ad_rss ad_rss_map_integration && colcon test-result"
BUILDCMD: "colcon build --event-handlers console_direct+ --executor sequential --packages-up-to ad_rss ad_rss_map_integration --cmake-args -DBUILD_HARDENING=ON -DBUILD_TESTING=ON -DBUILD_PYTHON_BINDING=ON -DPYTHON_BINDING_VERSION=${PYTHON_BINDING_VERSION} && colcon test --event-handlers console_direct+ --packages-select ad_rss ad_rss_map_integration && colcon test-result"

jobs:
ubuntu16job:
Expand All @@ -22,18 +22,22 @@ jobs:
EXTRA_PACKAGES: ""
CC: ""
CXX: ""
PYTHON_BINDING_VERSION: "2.7"
- compiler: gcc6
EXTRA_PACKAGES: g++-6
CC: /usr/bin/gcc-6
CXX: /usr/bin/g++-6
PYTHON_BINDING_VERSION: "2.7"
- compiler: clang5
EXTRA_PACKAGES: clang-5.0
CC: /usr/bin/clang-5.0
CXX: /usr/bin/clang++-5.0
PYTHON_BINDING_VERSION: "2.7"
- compiler: clang6
EXTRA_PACKAGES: clang-6.0
CC: /usr/bin/clang-6.0
CXX: /usr/bin/clang++-6.0
PYTHON_BINDING_VERSION: "2.7"

steps:
- uses: actions/checkout@v2
Expand All @@ -48,6 +52,7 @@ jobs:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
EXTRA_PACKAGES: ${{ matrix.EXTRA_PACKAGES }}
PYTHON_BINDING_VERSION: ${{ matrix.PYTHON_BINDING_VERSION }}
run: |
sudo apt-get install ${EXTRA_PACKAGES}
rm -rf log build install
Expand All @@ -64,22 +69,27 @@ jobs:
EXTRA_PACKAGES: ""
CC: ""
CXX: ""
PYTHON_BINDING_VERSION: "2.7"
- compiler: gcc8
EXTRA_PACKAGES: g++-8
CC: /usr/bin/gcc-8
CXX: /usr/bin/g++-8
PYTHON_BINDING_VERSION: "3.6 -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3.6"
- compiler: gcc9
EXTRA_PACKAGES: g++-9
CC: /usr/bin/gcc-9
CXX: /usr/bin/g++-9
PYTHON_BINDING_VERSION: "3.6 -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3.6"
- compiler: clang7
EXTRA_PACKAGES: clang-7
CC: /usr/bin/clang-7
CXX: /usr/bin/clang++-7
PYTHON_BINDING_VERSION: "3.6 -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3.6"
- compiler: clang8
EXTRA_PACKAGES: clang-8
CC: /usr/bin/clang-8
CXX: /usr/bin/clang++-8
PYTHON_BINDING_VERSION: "3.6 -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3.6"

steps:
- uses: actions/checkout@v2
Expand All @@ -94,6 +104,7 @@ jobs:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
EXTRA_PACKAGES: ${{ matrix.EXTRA_PACKAGES }}
PYTHON_BINDING_VERSION: ${{ matrix.PYTHON_BINDING_VERSION }}
run: |
sudo apt-get install ${EXTRA_PACKAGES}
rm -rf log build install
Expand All @@ -110,6 +121,7 @@ jobs:
EXTRA_PACKAGES: ""
CC: ""
CXX: ""
PYTHON_BINDING_VERSION: "3.8"

steps:
- uses: actions/checkout@v2
Expand All @@ -124,6 +136,7 @@ jobs:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
EXTRA_PACKAGES: ${{ matrix.EXTRA_PACKAGES }}
PYTHON_BINDING_VERSION: ${{ matrix.PYTHON_BINDING_VERSION }}
run: |
sudo apt-get install ${EXTRA_PACKAGES}
rm -rf log build install
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/install_dependencies.sh
Expand Up @@ -4,20 +4,15 @@ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y --no-install-recommends build-essential castxml cmake libboost-all-dev libgtest-dev liblapacke-dev libopenblas-dev libproj-dev libpugixml-dev libpython3-dev python python-setuptools python3 python3-pip python3-setuptools python3-wheel

if [ `lsb_release -a | grep Release | grep 20.04 | wc -l` == 1 ]; then
if [ `lsb_release -a | grep Release | grep 20.04 | wc -l` == 1 ]; then
sudo apt-get install -y --no-install-recommends python-is-python3
else
sudo apt-get install -y --no-install-recommends python-pip python-wheel
fi
sudo pip3 install --upgrade setuptools==51.1.2
sudo pip3 install colcon-common-extensions xmlrunner
sudo pip3 install colcon-common-extensions xmlrunner pygccxml pyplusplus

if [ `lsb_release -a | grep Release | grep 20.04 | wc -l` == 1 ]; then
sudo pip3 install pygccxml pyplusplus
else
if [ `lsb_release -a | grep Release | grep 20.04 | wc -l` != 1 ]; then
sudo pip2 install --upgrade setuptools==41.1.0
sudo pip2 install pygccxml pyplusplus xmlrunner
fi



47 changes: 47 additions & 0 deletions .github/workflows/wheels.yml
@@ -0,0 +1,47 @@
name: Build and Publish wheels for ad-rss-lib Library

on:
release:
types: [published]
push:
branches: master
pull_request:
branches: master

jobs:
wheels:
runs-on: ubuntu-latest
strategy:
matrix:
python_binding_version: [2.7, 3.6, 3.7, 3.8]
container:
image: joelmb/map:${{ matrix.python_binding_version }}
env:
WHEEL_PLATFORM: manylinux_2_27_x86_64
PYTHON_BINDING_VERSION: ${{ matrix.python_binding_version }}
steps:
# We currently cannot use checkout@v2 because git version on the docker images is below 2.18
- uses: actions/checkout@v1
with:
fetch-depth: 1
submodules: true
- name: Build wheels
run: |
colcon build --packages-up-to ad_rss_map_integration --meta colcon_python.meta --event-handlers console_direct+ --cmake-args -DPYTHON_BINDING_VERSION=${PYTHON_BINDING_VERSION}
- name: Repair wheels
shell: bash
run: |
source install/setup.bash
for whl in install/ad_rss/dist/*.whl; do
auditwheel repair $whl --plat ${WHEEL_PLATFORM} --wheel-dir wheelhouse
done
for whl in install/ad_rss_map_integration/dist/*.whl; do
auditwheel repair $whl --plat ${WHEEL_PLATFORM} --wheel-dir wheelhouse
done
- name: Publish wheels to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ github.event_name == 'release'}}
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: wheelhouse/

0 comments on commit 2ce3bc8

Please sign in to comment.