From d504247d385640f79a06c41422649a2ddd924a72 Mon Sep 17 00:00:00 2001 From: Rik Bouwmeester Date: Thu, 17 Oct 2024 17:00:24 +0200 Subject: [PATCH 1/9] 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 2/9] 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 3/9] 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 4/9] 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 5/9] 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 6/9] 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 7/9] 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 8/9] 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 9/9] 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