From b6636485af0e980f02323b312097c0c511ab088c Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Tue, 2 Jun 2020 08:04:35 +0200 Subject: [PATCH 1/5] README: move doc generation down --- README.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 49bf0ef2..948e71ce 100644 --- a/README.md +++ b/README.md @@ -89,14 +89,6 @@ Run the following helper script. It will generate the Python wrappers for each p ./other/tools/run_protoc.sh ``` -### Generate the API documentation - -``` -pip3 install sphinx numpydoc -make -C mavsdk html -``` - - ### Update `mavsdk_server` version [MAVSDK_SERVER_VERSION](./MAVSDK_SERVER_VERSION) contains exactly the tag name of the `mavsdk_server` release corresponding to the version of MAVSDK-Python. When the [proto](./proto) submodule is updated here, chances are that `mavsdk_server` should be updated, too. Just edit this file, and the corresponding binary will be downloaded by the `setup.py` script (see below). @@ -112,6 +104,17 @@ pip3 install -e . Note: MAVDSK-Python runs `mavsdk/bin/mavsdk_server` when `await drone.connect()` is called. This binary comes from [MAVSDK](https://github.com/mavlink/MAVSDK/releases) and is downloaded during the `setup.py` step above. + +### Generate the API documentation + +Make sure the version is set correctly before generating and uploading new documentation. + +``` +pip3 install sphinx numpydoc +make -C mavsdk html +``` + + ### Release to PyPi repository The CI will create and push a wheel for Windows, Linux and macOS whenever a release tag is created. From 2b3fe5fa10dd065b6e4894431e192742d4089328 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Tue, 2 Jun 2020 08:04:49 +0200 Subject: [PATCH 2/5] README: clarify release process --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 948e71ce..76dc1818 100644 --- a/README.md +++ b/README.md @@ -117,4 +117,4 @@ make -C mavsdk html ### Release to PyPi repository -The CI will create and push a wheel for Windows, Linux and macOS whenever a release tag is created. +The CI will create and push a wheel for Windows, Linux and macOS to PyPi whenever a tag is pushed and a release created. From 9b125a5591781d972c3bf57234ede322f28de412 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Tue, 2 Jun 2020 08:19:26 +0200 Subject: [PATCH 3/5] sphinx: get version from git tag --- mavsdk/source/conf.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mavsdk/source/conf.py b/mavsdk/source/conf.py index 863b72ae..37ee0d4f 100644 --- a/mavsdk/source/conf.py +++ b/mavsdk/source/conf.py @@ -14,15 +14,18 @@ # import sys # sys.path.insert(0, os.path.abspath('.')) - # -- Project information ----------------------------------------------------- +import subprocess project = 'MAVSDK-Python' copyright = '2020, Jonas Vautherin, Julian Oes' author = 'Jonas Vautherin, Julian Oes' +result = subprocess.run(['git', 'describe', '--tag', '--abbrev=0'], + stdout=subprocess.PIPE) + # The full version, including alpha/beta/rc tags -release = '0.7.0' +release = result.stdout.decode('utf-8') # -- General configuration --------------------------------------------------- From 48502543eb0a0b18549be4085b8e29b36410f3b5 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Tue, 2 Jun 2020 08:28:49 +0200 Subject: [PATCH 4/5] travis-ci: upload docs in CI --- .travis.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.travis.yml b/.travis.yml index 42c25b3d..08c878ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -77,6 +77,9 @@ install: - set -e - pip3 install -r requirements.txt -r requirements-dev.txt - pip3 install auditwheel twine +- if [[ "${BUILD_TARGET}" = "linux" ]]; then + pip3 install sphinx numpydoc s3cmd; + fi - if [[ "${BUILD_TARGET}" = "macos" ]]; then pip3 install delocate; fi @@ -89,6 +92,7 @@ script: fi - if [[ "${BUILD_TARGET}" = "linux" ]]; then auditwheel repair --plat manylinux2010_x86_64 dist/*.whl; + make -C mavsdk html; fi - if [[ "${BUILD_TARGET}" = "macos" ]]; then delocate-wheel -w wheelhouse -v dist/*.whl; @@ -110,7 +114,15 @@ script: else echo "Not deploying without git tag."; fi +- if [[ "${BUILD_TARGET}" = "linux" ]] && [[ ! -z "${TRAVIS_TAG}" ]]; then + echo "Uploading docs"; + other/tools/upload_docs.sh; + else + echo "Not uploading docs without git tag."; + fi env: global: - secure: cpJLKiOqUTYB1ozkVus4SlPBP/XJ1uUxfMKos+XLWxEVOTguLIW+bKhLfquY9+PlY2rajl5jxxzrX5RZOgZR0fbHHh9FAzioWhzEEUQb76IKnDD7St8J6Pq65bO1Vk8o0sdtQ+ht8+RK54TJL6d8jxVh4RNV3txBB6wFzkFcw5WTDxgWr/+HsYfC9IQkIXGf8NJmvdCUBunL2xDULZ3rlPzEG/YmXjR79g51juNWvZjDKFjLmpHe/qN8VSws1QrI7tKtTtNrNutlAVnOWSlcnJspzex0WfG4EINyjJH7WQZppLiax55jWSBAzxee3/7jXyDVDOJBPl8JT/GyqoQL/qHDmiJuHm53Ktpgg0saGlcSuYuA643PVVJ2Q1SerTtboukJIfNi08GykSPLIbT6PHqhB7NzaA+rWXWgTIoMUyPQ38M+/2lpVqNc6fwAClAbYrJKxyiH7g6GLShV5/UOqDWK18OGGYnpWs+X2eFPXFXLVfZ540VvqlZimwMd6PZuB6RpgKBcBPH1FMac1dE0+FaNHHHj9KNONkiTfzJCFEThwTtS0z3xrKzq8q8iAmbbhTKMJjwID0hpdKdfvzxkPW7IJiW/zG5X2WBL5gB2bhKhpkiozZCuO087aPxPx6Y+Jua5nt3hm3p1tVqZD3hX+SNv4ymHXfsyeIvweLKi0QQ= - secure: CiOtzgly9Rl0KwaA3W3FJTzSaUoSpRVPgSRj+x9UdmDBKHm9dvW3kc5amsUKzx7jF9qb2Cuyw2Bg9kmq7SIIqvvN14/3NkzTb2aDpE+f/O627asKJlrr5CuQtmwFX//ZjLIeLFPySBj/Oz1SUz39hqtRVkyTAPfvxiVu52AQveXqyxhcgC5ALI/kIAVaWeKBqH8f6PJ5HUphL2u+QOO1/r88tEumbmVUA6tvQZxHUsu7tU1SOwB4SAfCwTfwJ8h0ZUEicuTkUB3KJc6gDWF8i2AUi1akrysAO4DDd606K1APA7QusTq+PP16tG23ul6kmme8SNRXZUouqGv902giif3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2rzkSj6j3djUcowhThi3bRhmJy/stHvs+0eAEY3UvW0TMrnC34+JN6WnAx60EfQSLr0Imrzv55RDbLWDVyzC50ks95iRSCtkZnXL2OUdoIqTZMiV3fbJS1kxy8K3k00qiBLwviHC9FSV+Ujz9nIQDJfLEELDzQVFEOMRd+qfJYkkVIRUl9VThC25T1ykN0A3jL1SI9tc5+XHdEy8poKjtncXjdGu9AS1vxSJsc0oOkbn9quRW+GYq3J105BHtMjfTHWRVsTyMeRgimxeMWq+l9bD28/K8ou1dhvdY1CAZLZUOeDDDPsWrWDYdD3pk+Dehur2H0raEOMvfEOfYKgN2vRPxX0hlwFTaumCHElEHZN0sHw5fwDYOo4uCFEUr1kMm2KBth3NvckHLpOGI+yrUuSmeVgrnpz5aO9V4/I9+lK1FarcvBeh6ERThO33bcTpF1GVWYdFxS4p9xoggtz5mra+nddNS1jrVJYa4P1AL9HFKcu7wjCRZFSLHL1lPP+4p2N4nIRxiWmjX5aG2gASDO/qld5ZtwhePyI5JxAMp0vMBTx9aFEbc7y2F0SlyPtUKin0RQ1SRG8q+P37Jug936EAbhsVm3/Wi/KtDCGxyM0zqMs06ANidU= From 52dfd412d20a4e17fa871cf8afccb77ee1e84867 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Tue, 2 Jun 2020 08:30:38 +0200 Subject: [PATCH 5/5] README: clarify release process --- README.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 76dc1818..98754a11 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ Note: MAVDSK-Python runs `mavsdk/bin/mavsdk_server` when `await drone.connect()` ### Generate the API documentation -Make sure the version is set correctly before generating and uploading new documentation. +Make sure the version tag is set correctly before generating new documentation. ``` pip3 install sphinx numpydoc @@ -115,6 +115,18 @@ make -C mavsdk html ``` -### Release to PyPi repository +### Release steps -The CI will create and push a wheel for Windows, Linux and macOS to PyPi whenever a tag is pushed and a release created. +1. Check all required pull requests are merged to master +2. Check [MAVSDK_SERVER_VERSION](MAVSDK_SERVER_VERSION) is set to the correct version of mavsdk_server. +3. Create git tag on laster master, e.g.: + ``` + git switch master + git pull + git tag X.Y.Z + git push --tags + ``` +4. Go to [releases page](https://github.com/mavlink/MAVSDK-Python/releases) and create new release. + The CI will now: + - Create and push a wheel for Windows, Linux and macOS to PyPi. + - Generate the latest docs and push them to s3.