Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d504247
Stop building universal wheels
gemenerik Oct 17, 2024
8cec9b8
Switch to pyproject.toml for package configuration
gemenerik Oct 24, 2024
ab3f748
Merge branch 'master' into rik/python_build
gemenerik Oct 24, 2024
1585ee7
Update expected inputs in test-python-publish.yml
gemenerik Nov 18, 2024
7323c09
Trusted publish to test pypi
gemenerik Nov 18, 2024
8fe7f72
Update test-python-publish.yml
gemenerik Nov 18, 2024
efcd52d
Update pyproject.toml
gemenerik Nov 18, 2024
1319daa
Update homepage
gemenerik Nov 18, 2024
dc658aa
Update version to 0.1.27.1.dev0
gemenerik Nov 18, 2024
6d8d974
Trusted publish to pypi
gemenerik Nov 18, 2024
9313d01
Merge pull request #491 from bitcraze/rik/python_build
gemenerik Nov 19, 2024
608f5f0
Update dependencies, metadata
gemenerik Nov 20, 2024
52bff9d
Include Python 3.13 installation instructions
gemenerik Nov 20, 2024
95ced81
Automatic versioning
gemenerik Nov 20, 2024
1652896
Support auto versioning in GitHub publishing workflows
gemenerik Nov 20, 2024
4fc747d
Run dependency check on all supported Python versions
gemenerik Nov 20, 2024
b2772f0
Run dependency check weekly on Friday at 02:00
gemenerik Nov 20, 2024
840d891
Introduce nightly build and test
gemenerik Nov 20, 2024
a59ff76
Use self-hosted MacOS runner
gemenerik Nov 20, 2024
e5048d4
Update nightly.yml
gemenerik Nov 20, 2024
2866ce0
Install required dependencies for nightly. Run same script as docker …
gemenerik Nov 20, 2024
83e78ce
First build to fetch dependencies
gemenerik Nov 20, 2024
c1e97cf
Nightly: build wheel, pip install it. First run pre-commit checks. Bu…
gemenerik Nov 21, 2024
bdffcc8
Install setuptools, yaml for generating docs
gemenerik Nov 21, 2024
5d0ccc7
Find wheel on Windows
gemenerik Nov 21, 2024
14cf8b5
Use Brew Python on MacOs
gemenerik Nov 21, 2024
ce1afca
Merge pull request #496 from bitcraze/rik/nightly
gemenerik Nov 21, 2024
6623336
Merge pull request #495 from bitcraze/rik/build
ataffanel Nov 21, 2024
ec74aa4
Use Visual Studio for compiling wheels
gemenerik Nov 21, 2024
414af4d
Merge pull request #497 from bitcraze/rik/msvc
gemenerik Nov 21, 2024
02cfb05
Update dependency_check.yml
gemenerik Nov 22, 2024
580903f
Remove now redundant dependency check
gemenerik Nov 22, 2024
1d4c5e8
Remove deprecated call to setDaemon
ataffanel Nov 28, 2024
6b4d3ba
Merge pull request #498 from bitcraze/ataffanel/remove-setDaemon
gemenerik Nov 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 0 additions & 49 deletions .github/workflows/dependency_check.yml

This file was deleted.

87 changes: 87 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# 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:
fail-fast: false
matrix:
os: [ubuntu-latest, lab-mac, 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 }}
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: 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
python3 -m pip install pre-commit

- name: Code quality checks
run: pre-commit run --all-files

- name: Build wheel
run: python3 -m build --wheel

- 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/

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 setuptools
python3 -m pip install pdoc3 pyyaml
- name: Build docs
run: ./tools/build-docs/build-docs
10 changes: 8 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,16 @@ jobs:
deploy:

runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/cflib
permissions:
id-token: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand All @@ -34,5 +41,4 @@ jobs:
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
username: __token__
password: ${{ secrets.PYPI_TOKEN }}
verbose: true
12 changes: 9 additions & 3 deletions .github/workflows/test-python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,16 @@ 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
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand All @@ -34,6 +41,5 @@ jobs:
- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
username: __token__
password: ${{ secrets.PYPI_TEST_TOKEN }}
repository_url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/
verbose: true
2 changes: 1 addition & 1 deletion cflib/crazyflie/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 2 additions & 2 deletions cflib/crazyflie/param.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cflib/crtp/radiodriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def __init__(self, devid: int):

self._lock = Semaphore(1)

self.setDaemon(True)
self.daemon = True

self.start()

Expand Down
3 changes: 3 additions & 0 deletions docs/installation/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
```
Expand Down
64 changes: 64 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[build-system]
requires = ["setuptools>=61.0", "wheel", "setuptools_scm"]
build-backend = "setuptools.build_meta"

[project]
name = "cflib"
dynamic = ["version"]
description = "Crazyflie Python driver"
authors = [
{ name = "Bitcraze and contributors", email = "[email protected]" },
]

readme = {file = "README.md", content-type = "text/markdown"}
license = { text = "GPLv3" }
keywords = ["driver", "crazyflie", "quadcopter"]

classifiers = [
"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",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
requires-python = ">= 3.10"

dependencies = [
"pyusb~=1.2",
"libusb-package~=1.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/"
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"]

[tool.setuptools_scm]
version_scheme = "no-guess-dev"
2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

56 changes: 0 additions & 56 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion tools/build/bdist
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down