From d504247d385640f79a06c41422649a2ddd924a72 Mon Sep 17 00:00:00 2001 From: Rik Bouwmeester Date: Thu, 17 Oct 2024 17:00:24 +0200 Subject: [PATCH 01/28] Stop building universal wheels --- setup.cfg | 2 +- setup.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 3c6e79cf3..aa76baec6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,2 @@ [bdist_wheel] -universal=1 +universal=0 diff --git a/setup.py b/setup.py index fdcd5e5a5..096f1f87e 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,6 @@ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', 'Topic :: System :: Hardware :: Hardware Drivers', - 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3' ], From 8cec9b8d63ef34a41453314816637c94e1a06c90 Mon Sep 17 00:00:00 2001 From: Rik Bouwmeester Date: Thu, 24 Oct 2024 11:25:11 +0200 Subject: [PATCH 02/28] Switch to pyproject.toml for package configuration - Migrated from setup.py to pyproject.toml for better compliance with modern PEP - Identical package metadata, dependencies, and long description in the new configuration. - Enforce supported Python version --- pyproject.toml | 55 +++++++++++++++++++++++++++++++++++++++++++++++ setup.cfg | 2 -- setup.py | 55 ----------------------------------------------- tools/build/bdist | 2 +- 4 files changed, 56 insertions(+), 58 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..486047402 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,55 @@ +[build-system] +requires = ["setuptools>=61.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "cflib" +version = "0.1.27" +description = "Crazyflie Python driver" +authors = [ + { name = "Bitcraze and contributors", email = "contact@bitcraze.io" }, +] + +readme = {file = "README.md", content-type = "text/markdown"} +license = { text = "GPLv3" } +keywords = ["driver", "crazyflie", "quadcopter"] + +classifiers = [ + "Development Status :: 4 - Beta", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Topic :: System :: Hardware :: Hardware Drivers", + + # Supported Python versions + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", +] +requires-python = ">= 3.10" + +dependencies = [ + "pyusb>=1.0.0b2", + "libusb-package~=1.0", + "scipy~=1.7", + "numpy~=1.20", + "packaging~=24.0", +] + + +[project.urls] +Homepage = "bitcraze.io" +Documentation = "https://www.bitcraze.io/documentation/repository/crazyflie-lib-python/master/" +Repository = "https://github.com/bitcraze/crazyflie-lib-python" +Issues = "https://github.com/bitcraze/crazyflie-lib-python/issues" + +[project.optional-dependencies] +dev = ["pre-commit"] + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.packages] +find = { exclude = ["examples", "test"] } + +[tool.setuptools.package-data] +"cflib.resources.binaries" = ["cflib/resources/binaries/*.bin"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index aa76baec6..000000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[bdist_wheel] -universal=0 diff --git a/setup.py b/setup.py deleted file mode 100644 index 096f1f87e..000000000 --- a/setup.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python3 -from pathlib import Path - -from setuptools import find_packages -from setuptools import setup -# read the contents of README.md file fo use in pypi description -directory = Path(__file__).parent -long_description = (directory / 'README.md').read_text() - -package_data = { - 'cflib.resources.binaries': ['cflib/resources/binaries/*.bin'], -} - -setup( - name='cflib', - version='0.1.27', - packages=find_packages(exclude=['examples', 'test']), - - description='Crazyflie python driver', - url='https://github.com/bitcraze/crazyflie-lib-python', - - long_description=long_description, - long_description_content_type='text/markdown', - - author='Bitcraze and contributors', - author_email='contact@bitcraze.io', - license='GPLv3', - - classifiers=[ - 'Development Status :: 4 - Beta', - 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', - 'Topic :: System :: Hardware :: Hardware Drivers', - 'Programming Language :: Python :: 3' - ], - - keywords='driver crazyflie quadcopter', - - install_requires=[ - 'pyusb>=1.0.0b2', - 'libusb-package~=1.0', - 'scipy~=1.7', - 'numpy~=1.20', - 'packaging~=24.0', - ], - - # $ pip install -e .[dev] - extras_require={ - 'dev': [ - 'pre-commit' - ], - }, - - include_package_data=True, - package_data=package_data -) diff --git a/tools/build/bdist b/tools/build/bdist index c0bc8dc31..40a9acd04 100755 --- a/tools/build/bdist +++ b/tools/build/bdist @@ -9,7 +9,7 @@ try: script_dir = os.path.dirname(os.path.realpath(__file__)) root = _path.normpath(_path.join(script_dir, '../..')) - subprocess.check_call(['python3', 'setup.py', 'bdist_wheel'], cwd=root) + subprocess.check_call(['python3', '-m', 'build', '--wheel'], cwd=root) print('Wheel built') except subprocess.CalledProcessError as e: From 1585ee7b93c87aafefce3fa8f2f06227022512a2 Mon Sep 17 00:00:00 2001 From: Rik <49898887+gemenerik@users.noreply.github.com> Date: Mon, 18 Nov 2024 14:03:53 +0100 Subject: [PATCH 03/28] Update expected inputs in test-python-publish.yml --- .github/workflows/test-python-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-python-publish.yml b/.github/workflows/test-python-publish.yml index 444e635f2..cb9dd7fb5 100644 --- a/.github/workflows/test-python-publish.yml +++ b/.github/workflows/test-python-publish.yml @@ -34,6 +34,6 @@ jobs: - name: Publish package to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: - username: __token__ + user: __token__ password: ${{ secrets.PYPI_TEST_TOKEN }} - repository_url: https://test.pypi.org/legacy/ + repository-url: https://test.pypi.org/legacy/ From 7323c09c06d07a70217110736c70c698ec453952 Mon Sep 17 00:00:00 2001 From: Rik <49898887+gemenerik@users.noreply.github.com> Date: Mon, 18 Nov 2024 14:19:10 +0100 Subject: [PATCH 04/28] Trusted publish to test pypi --- .github/workflows/test-python-publish.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-python-publish.yml b/.github/workflows/test-python-publish.yml index cb9dd7fb5..77f81444e 100644 --- a/.github/workflows/test-python-publish.yml +++ b/.github/workflows/test-python-publish.yml @@ -18,6 +18,11 @@ jobs: deploy: runs-on: ubuntu-latest + environment: + name: pypi-test + url: https://pypi.org/p/cflib + permissions: + id-token: write steps: - uses: actions/checkout@v4 @@ -34,6 +39,4 @@ jobs: - name: Publish package to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: - user: __token__ - password: ${{ secrets.PYPI_TEST_TOKEN }} repository-url: https://test.pypi.org/legacy/ From 8fe7f726465c2b9413a7dcb2962e63ff7c9ed036 Mon Sep 17 00:00:00 2001 From: Rik <49898887+gemenerik@users.noreply.github.com> Date: Mon, 18 Nov 2024 14:46:29 +0100 Subject: [PATCH 05/28] Update test-python-publish.yml --- .github/workflows/test-python-publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-python-publish.yml b/.github/workflows/test-python-publish.yml index 77f81444e..947a42101 100644 --- a/.github/workflows/test-python-publish.yml +++ b/.github/workflows/test-python-publish.yml @@ -40,3 +40,4 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: https://test.pypi.org/legacy/ + verbose: true From efcd52dfcd094933a12c5835d05a22d9e6f76016 Mon Sep 17 00:00:00 2001 From: Rik <49898887+gemenerik@users.noreply.github.com> Date: Mon, 18 Nov 2024 14:55:51 +0100 Subject: [PATCH 06/28] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 486047402..16573a991 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "cflib" -version = "0.1.27" +version = "0.1.27.dev0" description = "Crazyflie Python driver" authors = [ { name = "Bitcraze and contributors", email = "contact@bitcraze.io" }, From 1319daa95713c9b44040f52584b77784a0a76a8c Mon Sep 17 00:00:00 2001 From: Rik <49898887+gemenerik@users.noreply.github.com> Date: Mon, 18 Nov 2024 14:58:27 +0100 Subject: [PATCH 07/28] Update homepage --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 16573a991..46dbea9e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ dependencies = [ [project.urls] -Homepage = "bitcraze.io" +Homepage = "https://www.bitcraze.io" Documentation = "https://www.bitcraze.io/documentation/repository/crazyflie-lib-python/master/" Repository = "https://github.com/bitcraze/crazyflie-lib-python" Issues = "https://github.com/bitcraze/crazyflie-lib-python/issues" From dc658aa611b1cadb9a8852ac3853389e3dda15a8 Mon Sep 17 00:00:00 2001 From: Rik <49898887+gemenerik@users.noreply.github.com> Date: Mon, 18 Nov 2024 15:06:20 +0100 Subject: [PATCH 08/28] Update version to 0.1.27.1.dev0 0.1.27.dev0 is considered < 1.1.27 breaking compatibility with latest cfclient release New version is considered pre-release of 0.1.27.1 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 46dbea9e6..c6c3c4d37 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "cflib" -version = "0.1.27.dev0" +version = "0.1.27.1.dev0" description = "Crazyflie Python driver" authors = [ { name = "Bitcraze and contributors", email = "contact@bitcraze.io" }, From 6d8d974da592b3ef7431761bff5ecb799b62c69d Mon Sep 17 00:00:00 2001 From: Rik <49898887+gemenerik@users.noreply.github.com> Date: Mon, 18 Nov 2024 15:13:41 +0100 Subject: [PATCH 09/28] Trusted publish to pypi --- .github/workflows/python-publish.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 0dc3d068c..d5f2232b1 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -18,6 +18,11 @@ jobs: deploy: runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/cflib + permissions: + id-token: write steps: - uses: actions/checkout@v4 @@ -34,5 +39,4 @@ jobs: - name: Publish package uses: pypa/gh-action-pypi-publish@release/v1 with: - username: __token__ - password: ${{ secrets.PYPI_TOKEN }} + verbose: true From 608f5f0f43498366cedc8ff18e571e7c65fd5a9b Mon Sep 17 00:00:00 2001 From: Rik Bouwmeester Date: Wed, 20 Nov 2024 11:18:14 +0100 Subject: [PATCH 10/28] Update dependencies, metadata --- pyproject.toml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c6c3c4d37..e0d5f8d00 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,9 +15,16 @@ license = { text = "GPLv3" } keywords = ["driver", "crazyflie", "quadcopter"] classifiers = [ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Topic :: System :: Hardware :: Hardware Drivers", + "Topic :: Scientific/Engineering :: Robotics", + "Intended Audience :: Science/Research", + "Intended Audience :: Education", + "Intended Audience :: Developers", + "Operating System :: Linux", + "Operating System :: MacOS", + "Operating System :: Microsoft :: Windows", # Supported Python versions "Programming Language :: Python :: 3.10", @@ -28,14 +35,13 @@ classifiers = [ requires-python = ">= 3.10" dependencies = [ - "pyusb>=1.0.0b2", + "pyusb~=1.2", "libusb-package~=1.0", - "scipy~=1.7", - "numpy~=1.20", - "packaging~=24.0", + "scipy~=1.14", + "numpy~=1.26", + "packaging~=24.2", ] - [project.urls] Homepage = "https://www.bitcraze.io" Documentation = "https://www.bitcraze.io/documentation/repository/crazyflie-lib-python/master/" From 52bff9ddc07d1b04c757d302ce3821b87999a2bc Mon Sep 17 00:00:00 2001 From: Rik Bouwmeester Date: Wed, 20 Nov 2024 11:18:29 +0100 Subject: [PATCH 11/28] Include Python 3.13 installation instructions --- docs/installation/install.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/installation/install.md b/docs/installation/install.md index f8c696dda..a505d74e3 100644 --- a/docs/installation/install.md +++ b/docs/installation/install.md @@ -7,6 +7,7 @@ page_id: install This project requires Python 3.10+. +To install on Python 3.13, build tools and Python development headers are required. See below sections for more platform-specific requirements. ## Install from Source @@ -78,6 +79,8 @@ With linux, the crazyradio is easily recognized, but you have to setup UDEVpermi Look at the [Zadig crazyradio instructions](https://www.bitcraze.io/documentation/repository/crazyradio-firmware/master/building/usbwindows/) to install crazyradio on Windows +If you're using Python 3.13, you need to install [Visual Studio](https://visualstudio.microsoft.com/downloads/). During the installation process, you only need to select the Desktop Development with C++ workload in the Visual Studio Installer. + ### macOS If you are using python 3.12 on mac you need to install libusb using homebrew. ``` From 95ced817175552a9ad947eba35f4b615b1cadf4e Mon Sep 17 00:00:00 2001 From: Rik Bouwmeester Date: Wed, 20 Nov 2024 11:25:05 +0100 Subject: [PATCH 12/28] Automatic versioning Identical to cfclient --- pyproject.toml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e0d5f8d00..6677f6f41 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [build-system] -requires = ["setuptools>=61.0", "wheel"] +requires = ["setuptools>=61.0", "wheel", "setuptools_scm"] build-backend = "setuptools.build_meta" [project] name = "cflib" -version = "0.1.27.1.dev0" +dynamic = ["version"] description = "Crazyflie Python driver" authors = [ { name = "Bitcraze and contributors", email = "contact@bitcraze.io" }, @@ -59,3 +59,6 @@ find = { exclude = ["examples", "test"] } [tool.setuptools.package-data] "cflib.resources.binaries" = ["cflib/resources/binaries/*.bin"] + +[tool.setuptools_scm] +version_scheme = "no-guess-dev" From 16528967435b08d46b2b4ba0ef0806af1331590b Mon Sep 17 00:00:00 2001 From: Rik Bouwmeester Date: Wed, 20 Nov 2024 12:01:43 +0100 Subject: [PATCH 13/28] Support auto versioning in GitHub publishing workflows --- .github/workflows/python-publish.yml | 2 ++ .github/workflows/test-python-publish.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index d5f2232b1..0e197504e 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -26,6 +26,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Set up Python uses: actions/setup-python@v4 with: diff --git a/.github/workflows/test-python-publish.yml b/.github/workflows/test-python-publish.yml index 947a42101..2b4851bd3 100644 --- a/.github/workflows/test-python-publish.yml +++ b/.github/workflows/test-python-publish.yml @@ -26,6 +26,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Set up Python uses: actions/setup-python@v4 with: From 4fc747d76f20bd375f5027d3ffe9478b188a136a Mon Sep 17 00:00:00 2001 From: Rik <49898887+gemenerik@users.noreply.github.com> Date: Wed, 20 Nov 2024 14:29:27 +0100 Subject: [PATCH 14/28] Run dependency check on all supported Python versions --- .github/workflows/dependency_check.yml | 45 +++++++------------------- 1 file changed, 12 insertions(+), 33 deletions(-) diff --git a/.github/workflows/dependency_check.yml b/.github/workflows/dependency_check.yml index f2d09c69d..e18b680de 100644 --- a/.github/workflows/dependency_check.yml +++ b/.github/workflows/dependency_check.yml @@ -6,44 +6,23 @@ on: - cron: '0 2 * * *' jobs: - python-latest: + python-check: + strategy: + matrix: + python-version: [3.10, 3.11, 3.12, 3.13] runs-on: ubuntu-latest - container: - image: python:latest steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 - - name: python version - run: python --version - - - name: install lib - run: pip install -e . - - python-python311: - runs-on: ubuntu-latest - container: - image: python:3.11 - - steps: - - uses: actions/checkout@v4 - - - name: python version - run: python --version - - - name: install lib - run: pip install -e . - - minimum-python310: - runs-on: ubuntu-latest - container: - image: python:3.10 - - steps: - - uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} - - name: python version + - name: Verify Python version run: python --version - - name: install lib + - name: Install library run: pip install -e . From b2772f099dabb7fae5aa8e73fd6e284ab7712299 Mon Sep 17 00:00:00 2001 From: Rik <49898887+gemenerik@users.noreply.github.com> Date: Wed, 20 Nov 2024 14:35:11 +0100 Subject: [PATCH 15/28] Run dependency check weekly on Friday at 02:00 --- .github/workflows/dependency_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependency_check.yml b/.github/workflows/dependency_check.yml index e18b680de..8f9dbf3f0 100644 --- a/.github/workflows/dependency_check.yml +++ b/.github/workflows/dependency_check.yml @@ -3,7 +3,7 @@ name: Dependency check on: workflow_dispatch: schedule: - - cron: '0 2 * * *' + - cron: '0 2 * * 5' jobs: python-check: From 840d891c7214f2616b0805b691f4293a461f20f9 Mon Sep 17 00:00:00 2001 From: Rik <49898887+gemenerik@users.noreply.github.com> Date: Wed, 20 Nov 2024 14:48:03 +0100 Subject: [PATCH 16/28] Introduce nightly build and test On all supported OSes and Python versions --- .github/workflows/nightly.yml | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/nightly.yml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 000000000..b18984b2a --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,37 @@ +# Run check and build of the lib using the Bitcraze builder docker image +name: Nightly Build + +on: + workflow_dispatch: + schedule: + - cron: '0 2 * * *' + +jobs: + build-and-test: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: [3.10, 3.11, 3.12, 3.13] + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Verify + run: ./tools/build/verify + + - name: Test + run: ./tools/build/test + + - name: Build + run: ./tools/build/build + + - name: Build docs + run: ./tools/build-docs/build-docs From a59ff760ee3e39c1f494454a2f5cc46f94f466c7 Mon Sep 17 00:00:00 2001 From: Rik <49898887+gemenerik@users.noreply.github.com> Date: Wed, 20 Nov 2024 14:50:58 +0100 Subject: [PATCH 17/28] Use self-hosted MacOS runner --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index b18984b2a..d26e3b8d5 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -10,7 +10,7 @@ jobs: build-and-test: strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, lab-mac, windows-latest] python-version: [3.10, 3.11, 3.12, 3.13] runs-on: ${{ matrix.os }} From e5048d46f1e66d18df8e1f9b50ec7523b1ba1714 Mon Sep 17 00:00:00 2001 From: Rik <49898887+gemenerik@users.noreply.github.com> Date: Wed, 20 Nov 2024 14:52:47 +0100 Subject: [PATCH 18/28] Update nightly.yml --- .github/workflows/nightly.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d26e3b8d5..5fc1c9b03 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -9,6 +9,7 @@ on: jobs: build-and-test: strategy: + fail-fast: false matrix: os: [ubuntu-latest, lab-mac, windows-latest] python-version: [3.10, 3.11, 3.12, 3.13] From 2866ce02e0523e7054902879abbeb5adabd0d26d Mon Sep 17 00:00:00 2001 From: Rik Bouwmeester Date: Wed, 20 Nov 2024 15:09:08 +0100 Subject: [PATCH 19/28] Install required dependencies for nightly. Run same script as docker does. --- .github/workflows/nightly.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 5fc1c9b03..3cace8d8f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -12,10 +12,10 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, lab-mac, windows-latest] - python-version: [3.10, 3.11, 3.12, 3.13] - + python-version: ["3.10", "3.11", "3.12", "3.13"] + runs-on: ${{ matrix.os }} - + steps: - name: Checkout repo uses: actions/checkout@v4 @@ -25,13 +25,12 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Verify - run: ./tools/build/verify - - - name: Test - run: ./tools/build/test + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build pre-commit - - name: Build + - name: Verify, test, and build run: ./tools/build/build - name: Build docs From 83e78ce68d3bfd14e44435249635e99ade18ed48 Mon Sep 17 00:00:00 2001 From: Rik Bouwmeester Date: Wed, 20 Nov 2024 15:20:55 +0100 Subject: [PATCH 20/28] First build to fetch dependencies --- .github/workflows/nightly.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 3cace8d8f..4b2ef6be9 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -30,8 +30,14 @@ jobs: python -m pip install --upgrade pip pip install build pre-commit - - name: Verify, test, and build - run: ./tools/build/build + - name: Build + run: ./tools/build/bdist + + - name: Test + run: ./tools/build/test + + - name: Verify + run: ./tools/build/verify - name: Build docs run: ./tools/build-docs/build-docs From c1e97cfa868150c46f047b8872d61a344e1c6bc6 Mon Sep 17 00:00:00 2001 From: Rik Bouwmeester Date: Thu, 21 Nov 2024 10:01:43 +0100 Subject: [PATCH 21/28] Nightly: build wheel, pip install it. First run pre-commit checks. Build docs once. --- .github/workflows/nightly.yml | 36 +++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 4b2ef6be9..5dc87a18d 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -27,17 +27,33 @@ jobs: - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install build pre-commit + python3 -m pip install --upgrade pip build setuptools + python3 -m pip install pre-commit - - name: Build - run: ./tools/build/bdist + - name: Code quality checks + run: pre-commit run --all-files - - name: Test - run: ./tools/build/test + - name: Build wheel + run: python3 -m build --wheel + + - name: Install wheel + run: pip install ./dist/*.whl - - name: Verify - run: ./tools/build/verify + - name: Test + run: python3 -m unittest discover test/ - - name: Build docs - run: ./tools/build-docs/build-docs + build-docs: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python3 -m pip install --upgrade pip + python3 -m pip install pdoc3 + - name: Build docs + run: ./tools/build-docs/build-docs From bdffcc869da41b1fa60178aa6f27cd6069531521 Mon Sep 17 00:00:00 2001 From: Rik Bouwmeester Date: Thu, 21 Nov 2024 10:21:07 +0100 Subject: [PATCH 22/28] Install setuptools, yaml for generating docs --- .github/workflows/nightly.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 5dc87a18d..7e90600e6 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -53,7 +53,7 @@ jobs: python-version: '3.x' - name: Install dependencies run: | - python3 -m pip install --upgrade pip - python3 -m pip install pdoc3 + python3 -m pip install --upgrade pip setuptools + python3 -m pip install pdoc3 pyyaml - name: Build docs run: ./tools/build-docs/build-docs From 5d0ccc783cf37ed1ceac9eff73b21469dfe84f38 Mon Sep 17 00:00:00 2001 From: Rik Bouwmeester Date: Thu, 21 Nov 2024 10:21:24 +0100 Subject: [PATCH 23/28] Find wheel on Windows --- .github/workflows/nightly.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 7e90600e6..fca136120 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -36,8 +36,22 @@ jobs: - name: Build wheel run: python3 -m build --wheel - - name: Install wheel - run: pip install ./dist/*.whl + - name: Install the built wheel + run: | + # Find the built wheel + WHEEL_FILE=$(ls dist/*.whl | head -n 1) + echo "Installing wheel: $WHEEL_FILE" + pip install "$WHEEL_FILE" + shell: bash + if: runner.os != 'Windows' + + - name: Install the built wheel (Windows) + run: | + for /f %%i in ('dir /b dist\*.whl') do set WHEEL_FILE=dist\%%i + echo Installing wheel: %WHEEL_FILE% + pip install %WHEEL_FILE% + shell: cmd + if: runner.os == 'Windows' - name: Test run: python3 -m unittest discover test/ From 14cf8b55b6fddfbeb3324533d7f824b43fe08a1f Mon Sep 17 00:00:00 2001 From: Rik Bouwmeester Date: Thu, 21 Nov 2024 11:30:19 +0100 Subject: [PATCH 24/28] Use Brew Python on MacOs --- .github/workflows/nightly.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index fca136120..95dde3c57 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -21,10 +21,18 @@ jobs: uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} + if: runner.os == 'Linux' || runner.os == 'Windows' uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + - name: Set up Python ${{ matrix.python-version }} and venv on macOS + if: runner.os == 'macOS' + run: | + brew install python@${{ matrix.python-version }} + $(brew --prefix)/bin/python${{ matrix.python-version }} -m venv venv + echo "PATH=$(pwd)/venv/bin:$PATH" >> $GITHUB_ENV + - name: Install dependencies run: | python3 -m pip install --upgrade pip build setuptools From ec74aa48c4006fedee637fc9c612d66c829f282f Mon Sep 17 00:00:00 2001 From: Rik <49898887+gemenerik@users.noreply.github.com> Date: Thu, 21 Nov 2024 15:29:13 +0100 Subject: [PATCH 25/28] Use Visual Studio for compiling wheels --- .github/workflows/nightly.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 95dde3c57..cf3ba9f9c 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -33,6 +33,12 @@ jobs: $(brew --prefix)/bin/python${{ matrix.python-version }} -m venv venv echo "PATH=$(pwd)/venv/bin:$PATH" >> $GITHUB_ENV + - name: Set up MSVC environment (Windows) + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x64 + if: runner.os == 'Windows' + - name: Install dependencies run: | python3 -m pip install --upgrade pip build setuptools From 02cfb058e6c5dddeb036280cd4a8fc646e5b29ae Mon Sep 17 00:00:00 2001 From: Rik <49898887+gemenerik@users.noreply.github.com> Date: Fri, 22 Nov 2024 11:31:54 +0100 Subject: [PATCH 26/28] Update dependency_check.yml --- .github/workflows/dependency_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependency_check.yml b/.github/workflows/dependency_check.yml index 8f9dbf3f0..89d693aa1 100644 --- a/.github/workflows/dependency_check.yml +++ b/.github/workflows/dependency_check.yml @@ -9,7 +9,7 @@ jobs: python-check: strategy: matrix: - python-version: [3.10, 3.11, 3.12, 3.13] + python-version: ["3.10", "3.11", "3.12", "3.13"] runs-on: ubuntu-latest steps: From 580903f56c87161da810e102276d2451bb6748f7 Mon Sep 17 00:00:00 2001 From: Rik <49898887+gemenerik@users.noreply.github.com> Date: Fri, 22 Nov 2024 11:33:47 +0100 Subject: [PATCH 27/28] Remove now redundant dependency check This dependency check is now redundant with the nightly build --- .github/workflows/dependency_check.yml | 28 -------------------------- 1 file changed, 28 deletions(-) delete mode 100644 .github/workflows/dependency_check.yml diff --git a/.github/workflows/dependency_check.yml b/.github/workflows/dependency_check.yml deleted file mode 100644 index 89d693aa1..000000000 --- a/.github/workflows/dependency_check.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Dependency check - -on: - workflow_dispatch: - schedule: - - cron: '0 2 * * 5' - -jobs: - python-check: - strategy: - matrix: - python-version: ["3.10", "3.11", "3.12", "3.13"] - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Verify Python version - run: python --version - - - name: Install library - run: pip install -e . From 1d4c5e83a225d7f46956b25bf69899ebd8849b72 Mon Sep 17 00:00:00 2001 From: Arnaud Taffanel Date: Thu, 28 Nov 2024 11:11:18 +0100 Subject: [PATCH 28/28] Remove deprecated call to setDaemon --- cflib/crazyflie/__init__.py | 2 +- cflib/crazyflie/param.py | 4 ++-- cflib/crtp/radiodriver.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cflib/crazyflie/__init__.py b/cflib/crazyflie/__init__.py index cb9a0eed4..06f5e2e6d 100644 --- a/cflib/crazyflie/__init__.py +++ b/cflib/crazyflie/__init__.py @@ -109,7 +109,7 @@ def __init__(self, link=None, ro_cache=None, rw_cache=None): rw_cache=rw_cache) self.incoming = _IncomingPacketHandler(self) - self.incoming.setDaemon(True) + self.incoming.daemon = True if self.link: self.incoming.start() diff --git a/cflib/crazyflie/param.py b/cflib/crazyflie/param.py index 1dc199e8f..25ea37a0b 100644 --- a/cflib/crazyflie/param.py +++ b/cflib/crazyflie/param.py @@ -520,7 +520,7 @@ class _ExtendedTypeFetcher(Thread): def __init__(self, cf, toc): Thread.__init__(self) - self.setDaemon(True) + self.daemon = True self._lock = Lock() self._cf = cf @@ -599,7 +599,7 @@ class _ParamUpdater(Thread): def __init__(self, cf, useV2, updated_callback): """Initialize the thread""" Thread.__init__(self) - self.setDaemon(True) + self.daemon = True self.wait_lock = Lock() self.cf = cf self._useV2 = useV2 diff --git a/cflib/crtp/radiodriver.py b/cflib/crtp/radiodriver.py index 7d22b6c52..2d805f7c1 100644 --- a/cflib/crtp/radiodriver.py +++ b/cflib/crtp/radiodriver.py @@ -156,7 +156,7 @@ def __init__(self, devid: int): self._lock = Semaphore(1) - self.setDaemon(True) + self.daemon = True self.start()