Skip to content

Commit

Permalink
Merge pull request #1906 from mavlink/pr-install-pip-dependencies
Browse files Browse the repository at this point in the history
mavlink: install pymavlink dependencies
  • Loading branch information
julianoes authored Nov 17, 2022
2 parents ef011ac + 3b7e13e commit 0ddcb11
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 91 deletions.
38 changes: 8 additions & 30 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ jobs:
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=$(pwd)/build/third_party/install" >> $GITHUB_ENV
- name: Install lcov
run: sudo apt-get update && sudo apt-get install -y lcov
- name: install pymavlink dependencies
run: sudo apt-get install -y python3-future
- name: configure
run: cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Coverage -DASAN=ON -DWERROR=OFF -Bbuild -H.
- name: build
Expand Down Expand Up @@ -61,8 +59,6 @@ jobs:
submodules: recursive
- name: install
run: sudo apt-get update && sudo apt-get install -y libjsoncpp-dev libcurl4-openssl-dev libtinyxml2-dev
- name: install pymavlink dependencies
run: sudo apt-get install -y python3-future
- name: configure
run: cmake -DCMAKE_BUILD_TYPE=Release -DSUPERBUILD=OFF -DWERROR=OFF -Bbuild/release -H.
- name: build
Expand Down Expand Up @@ -90,8 +86,6 @@ jobs:
- name: disable superbuild on cache hit
if: steps.cache.outputs.cache-hit == 'true'
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=$(pwd)/build/release/third_party/install" >> $GITHUB_ENV
- name: install pymavlink dependencies
run: sudo apt-get update && sudo apt-get install -y python3-future
- name: configure
run: cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Release -DBUILD_MAVSDK_SERVER=ON -DWERROR=OFF -Bbuild/release -H.
- name: build
Expand Down Expand Up @@ -130,8 +124,6 @@ jobs:
with:
path: ~/.hunter
key: ${{ github.job }}-${{ hashFiles('~/.hunter/**') }}
- name: install pymavlink dependencies
run: sudo apt-get update && sudo apt-get install -y python3-future
- name: prepare mavlink headers because this is without superbuild
run: tools/generate_mavlink_headers.sh
- name: configure
Expand All @@ -152,8 +144,6 @@ jobs:
submodules: recursive
- name: install clang-format
run: sudo apt-get update && sudo apt-get install -y clang-format-12
- name: install pymavlink dependencies
run: sudo apt-get install -y python3-future
- uses: actions/cache@v2
id: cache
with:
Expand All @@ -180,8 +170,6 @@ jobs:
submodules: recursive
- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y doxygen clang-format-12
- name: install pymavlink dependencies
run: sudo apt-get install -y python3-future
- name: check style
run: ./tools/fix_style.sh .
- name: check docs
Expand Down Expand Up @@ -209,9 +197,7 @@ jobs:
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add -
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'
sudo apt-get update
sudo apt-get install -y cmake
- name: install pymavlink dependencies
run: sudo apt-get install -y python3-future
sudo apt-get install -y cmake python3-pip
- name: configure
run: cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_MAVSDK_SERVER=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=install -DWERROR=OFF -Bbuild/release -H.
- name: build
Expand Down Expand Up @@ -239,8 +225,6 @@ jobs:
fetch-depth: 0
- name: install packages
run: sudo apt-get update && sudo apt-get install -y build-essential debhelper fakeroot libjsoncpp-dev libcurl4-openssl-dev libtinyxml2-dev libjsoncpp1 libcurl4 libtinyxml2-6a
- name: install pymavlink dependencies
run: sudo apt-get install -y python3-future
- name: prepare mavlink headers because this is without superbuild
run: tools/generate_mavlink_headers.sh
- name: generate changelog
Expand Down Expand Up @@ -292,8 +276,6 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: install pymavlink dependencies
run: sudo apt-get update && sudo apt-get install -y python3 python3-future
- name: prepare mavlink headers
run: tools/generate_mavlink_headers.sh
- name: setup dockcross
Expand Down Expand Up @@ -328,7 +310,7 @@ jobs:
container: alpine:3.16.0
steps:
- name: install tools
run: apk update && apk add build-base cmake git linux-headers perl tar python3 py3-future
run: apk update && apk add build-base cmake git linux-headers perl tar python3 py3-pip
- uses: actions/checkout@v2
with:
submodules: recursive
Expand Down Expand Up @@ -381,7 +363,7 @@ jobs:
with:
submodules: recursive
- name: install pymavlink dependencies
run: sudo apt-get update && sudo apt-get install -y python3 python3-future
run: sudo apt-get update && sudo apt-get install -y python3 python3-pip
- name: prepare mavlink headers
run: tools/generate_mavlink_headers.sh
- name: setup dockcross
Expand Down Expand Up @@ -427,7 +409,7 @@ jobs:
with:
submodules: recursive
- name: install pymavlink dependencies
run: sudo apt-get update && sudo apt-get install -y python3 python3-future
run: sudo apt-get update && sudo apt-get install -y python3 python3-pip
- name: prepare mavlink headers
run: tools/generate_mavlink_headers.sh
- name: setup dockcross
Expand Down Expand Up @@ -482,8 +464,6 @@ jobs:
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=$(pwd)/build/macos/third_party/install" >> $GITHUB_ENV
- name: set SDKROOT value
run: echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV
- name: install pymavlink dependencies
run: python3 -m pip install future
- name: configure
run: cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/macos/install -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DMACOS_FRAMEWORK=${{ matrix.build-framework }} -DWERROR=OFF -Bbuild/macos -H.
- name: build
Expand Down Expand Up @@ -541,7 +521,10 @@ jobs:
run: |
echo "SDKROOT=$(xcrun --sdk ${{ matrix.sdk }} --show-sdk-path)" >> $GITHUB_ENV
- name: install pymavlink dependencies
run: python3 -m pip install future
run: |
python3 -m pip install --upgrade pip
python3 -m pip install wheel
python3 -m pip install future
- name: configure
run: cmake $superbuild $cmake_prefix_path -DENABLE_STRICT_TRY_COMPILE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$(pwd)/tools/ios.toolchain.cmake -DPLATFORM=${{ matrix.platform }} -DDEPLOYMENT_TARGET=13.0 -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DWERROR=OFF -Bbuild/${{ matrix.name }} -H.
- name: build
Expand Down Expand Up @@ -623,7 +606,6 @@ jobs:
run: |
python3 -m pip install --upgrade pip
python3 -m pip install wheel
python3 -m pip install future
- name: configure
run: cmake -G "Visual Studio 17 2022" $env:superbuild $env:cmake_prefix_path -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/release/install -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DWERROR=OFF -Bbuild/release -S.
- name: build
Expand Down Expand Up @@ -666,8 +648,6 @@ jobs:
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config --global --add safe.directory /github/workspace
- name: install pymavlink dependencies
run: python3 -m pip install future
- name: test
run: PX4_VERSION=${{ matrix.px4_version }} tools/run-sitl-tests.sh /home/user/Firmware
timeout-minutes: 45
Expand Down Expand Up @@ -700,8 +680,6 @@ jobs:
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config --global --add safe.directory /github/workspace
- name: install pymavlink dependencies
run: python3 -m pip install future
- name: test
run: APM_VERSION=${{ matrix.apm_version }} tools/run-sitl-tests.sh /home/user/ArduPilot
timeout-minutes: 45
56 changes: 0 additions & 56 deletions docker/Dockerfile-Fedora-34

This file was deleted.

2 changes: 1 addition & 1 deletion docker/Dockerfile-Fedora-35
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ RUN dnf -y install \
ninja-build \
perl-FindBin \
python \
python-future \
python-pip \
redhat-rpm-config \
rpm-build \
ruby-devel \
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile-Fedora-36
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ RUN dnf -y install \
ninja-build \
perl-FindBin \
python \
python-future \
python-pip \
redhat-rpm-config \
rpm-build \
ruby-devel \
Expand Down
2 changes: 0 additions & 2 deletions docker/build_and_push_docker_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ then
DOCKER_CMD=podman
fi

$DOCKER_CMD build -f Dockerfile-Fedora-34 -t mavsdk/mavsdk-fedora-34 .
$DOCKER_CMD build -f Dockerfile-Fedora-35 -t mavsdk/mavsdk-fedora-35 .
$DOCKER_CMD build -f Dockerfile-Fedora-36 -t mavsdk/mavsdk-fedora-36 .
$DOCKER_CMD build -f Dockerfile-Ubuntu-20.04 -t mavsdk/mavsdk-ubuntu-20.04 .
Expand All @@ -24,7 +23,6 @@ $DOCKER_CMD build -f Dockerfile.dockcross-linux-armv6-custom -t mavsdk/mavsdk-do
$DOCKER_CMD build -f Dockerfile.dockcross-linux-armv7-custom -t mavsdk/mavsdk-dockcross-linux-armv7-custom .
$DOCKER_CMD build -f Dockerfile.dockcross-linux-arm64-custom -t mavsdk/mavsdk-dockcross-linux-arm64-custom .

$DOCKER_CMD push mavsdk/mavsdk-fedora-34:latest
$DOCKER_CMD push mavsdk/mavsdk-fedora-35:latest
$DOCKER_CMD push mavsdk/mavsdk-fedora-36:latest
$DOCKER_CMD push mavsdk/mavsdk-ubuntu-20.04:latest
Expand Down
9 changes: 8 additions & 1 deletion third_party/mavlink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ if (NOT MAVLINK_DIALECT)
set(MAVLINK_DIALECT common)
endif()


if(NOT CMAKE_CROSSCOMPILING)
set(CONFIGURE_COMMAND
Python3::Interpreter -m pip install -r pymavlink/requirements.txt)
endif()

ExternalProject_add(
mavlink
GIT_REPOSITORY https://github.com/mavlink/mavlink
GIT_TAG c65c498efd2d9673e1d7da37025686daa5a7d568
PREFIX mavlink
CONFIGURE_COMMAND Python3::Interpreter
CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
COMMAND Python3::Interpreter
-m pymavlink.tools.mavgen
--lang=C
--wire-protocol=2.0
Expand Down
6 changes: 6 additions & 0 deletions tools/generate_mavlink_headers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ OUTPUT_PATH="$MAVLINK_HEADERS_PATH/include/mavlink/v2.0/"
mkdir -p "$OUTPUT_PATH"
OUTPUT_PATH=$(realpath $OUTPUT_PATH)

echo "Installing dependencies"
(cd $MAVLINK_PATH && \
python3 \
-m pip install -r pymavlink/requirements.txt)

echo "Generating headers"
(cd $MAVLINK_PATH && \
python3 \
-m pymavlink.tools.mavgen \
Expand Down

0 comments on commit 0ddcb11

Please sign in to comment.