Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit 2ce3bc8

Browse files
author
berndgassmann
authored
Python wheels (#113)
* 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
1 parent ee0136e commit 2ce3bc8

30 files changed

Lines changed: 1264 additions & 1218 deletions

.github/workflows/build_test.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
env:
1010
GTEST_OUTPUT: "xml:test_results"
11-
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"
11+
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"
1212

1313
jobs:
1414
ubuntu16job:
@@ -22,18 +22,22 @@ jobs:
2222
EXTRA_PACKAGES: ""
2323
CC: ""
2424
CXX: ""
25+
PYTHON_BINDING_VERSION: "2.7"
2526
- compiler: gcc6
2627
EXTRA_PACKAGES: g++-6
2728
CC: /usr/bin/gcc-6
2829
CXX: /usr/bin/g++-6
30+
PYTHON_BINDING_VERSION: "2.7"
2931
- compiler: clang5
3032
EXTRA_PACKAGES: clang-5.0
3133
CC: /usr/bin/clang-5.0
3234
CXX: /usr/bin/clang++-5.0
35+
PYTHON_BINDING_VERSION: "2.7"
3336
- compiler: clang6
3437
EXTRA_PACKAGES: clang-6.0
3538
CC: /usr/bin/clang-6.0
3639
CXX: /usr/bin/clang++-6.0
40+
PYTHON_BINDING_VERSION: "2.7"
3741

3842
steps:
3943
- uses: actions/checkout@v2
@@ -48,6 +52,7 @@ jobs:
4852
CC: ${{ matrix.CC }}
4953
CXX: ${{ matrix.CXX }}
5054
EXTRA_PACKAGES: ${{ matrix.EXTRA_PACKAGES }}
55+
PYTHON_BINDING_VERSION: ${{ matrix.PYTHON_BINDING_VERSION }}
5156
run: |
5257
sudo apt-get install ${EXTRA_PACKAGES}
5358
rm -rf log build install
@@ -64,22 +69,27 @@ jobs:
6469
EXTRA_PACKAGES: ""
6570
CC: ""
6671
CXX: ""
72+
PYTHON_BINDING_VERSION: "2.7"
6773
- compiler: gcc8
6874
EXTRA_PACKAGES: g++-8
6975
CC: /usr/bin/gcc-8
7076
CXX: /usr/bin/g++-8
77+
PYTHON_BINDING_VERSION: "3.6 -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3.6"
7178
- compiler: gcc9
7279
EXTRA_PACKAGES: g++-9
7380
CC: /usr/bin/gcc-9
7481
CXX: /usr/bin/g++-9
82+
PYTHON_BINDING_VERSION: "3.6 -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3.6"
7583
- compiler: clang7
7684
EXTRA_PACKAGES: clang-7
7785
CC: /usr/bin/clang-7
7886
CXX: /usr/bin/clang++-7
87+
PYTHON_BINDING_VERSION: "3.6 -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3.6"
7988
- compiler: clang8
8089
EXTRA_PACKAGES: clang-8
8190
CC: /usr/bin/clang-8
8291
CXX: /usr/bin/clang++-8
92+
PYTHON_BINDING_VERSION: "3.6 -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3.6"
8393

8494
steps:
8595
- uses: actions/checkout@v2
@@ -94,6 +104,7 @@ jobs:
94104
CC: ${{ matrix.CC }}
95105
CXX: ${{ matrix.CXX }}
96106
EXTRA_PACKAGES: ${{ matrix.EXTRA_PACKAGES }}
107+
PYTHON_BINDING_VERSION: ${{ matrix.PYTHON_BINDING_VERSION }}
97108
run: |
98109
sudo apt-get install ${EXTRA_PACKAGES}
99110
rm -rf log build install
@@ -110,6 +121,7 @@ jobs:
110121
EXTRA_PACKAGES: ""
111122
CC: ""
112123
CXX: ""
124+
PYTHON_BINDING_VERSION: "3.8"
113125

114126
steps:
115127
- uses: actions/checkout@v2
@@ -124,6 +136,7 @@ jobs:
124136
CC: ${{ matrix.CC }}
125137
CXX: ${{ matrix.CXX }}
126138
EXTRA_PACKAGES: ${{ matrix.EXTRA_PACKAGES }}
139+
PYTHON_BINDING_VERSION: ${{ matrix.PYTHON_BINDING_VERSION }}
127140
run: |
128141
sudo apt-get install ${EXTRA_PACKAGES}
129142
rm -rf log build install

.github/workflows/install_dependencies.sh

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,15 @@ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
44
sudo apt-get update
55
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
66

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

15-
if [ `lsb_release -a | grep Release | grep 20.04 | wc -l` == 1 ]; then
16-
sudo pip3 install pygccxml pyplusplus
17-
else
15+
if [ `lsb_release -a | grep Release | grep 20.04 | wc -l` != 1 ]; then
1816
sudo pip2 install --upgrade setuptools==41.1.0
1917
sudo pip2 install pygccxml pyplusplus xmlrunner
2018
fi
21-
22-
23-

.github/workflows/wheels.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build and Publish wheels for ad-rss-lib Library
2+
3+
on:
4+
release:
5+
types: [published]
6+
push:
7+
branches: master
8+
pull_request:
9+
branches: master
10+
11+
jobs:
12+
wheels:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
python_binding_version: [2.7, 3.6, 3.7, 3.8]
17+
container:
18+
image: joelmb/map:${{ matrix.python_binding_version }}
19+
env:
20+
WHEEL_PLATFORM: manylinux_2_27_x86_64
21+
PYTHON_BINDING_VERSION: ${{ matrix.python_binding_version }}
22+
steps:
23+
# We currently cannot use checkout@v2 because git version on the docker images is below 2.18
24+
- uses: actions/checkout@v1
25+
with:
26+
fetch-depth: 1
27+
submodules: true
28+
- name: Build wheels
29+
run: |
30+
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}
31+
- name: Repair wheels
32+
shell: bash
33+
run: |
34+
source install/setup.bash
35+
for whl in install/ad_rss/dist/*.whl; do
36+
auditwheel repair $whl --plat ${WHEEL_PLATFORM} --wheel-dir wheelhouse
37+
done
38+
for whl in install/ad_rss_map_integration/dist/*.whl; do
39+
auditwheel repair $whl --plat ${WHEEL_PLATFORM} --wheel-dir wheelhouse
40+
done
41+
- name: Publish wheels to PyPI
42+
uses: pypa/gh-action-pypi-publish@release/v1
43+
if: ${{ github.event_name == 'release'}}
44+
with:
45+
user: __token__
46+
password: ${{ secrets.PYPI_API_TOKEN }}
47+
packages_dir: wheelhouse/

0 commit comments

Comments
 (0)