Skip to content

Commit a175489

Browse files
authored
Merge pull request #1 from bitcraze/master
Upstream upadte
2 parents f9dd6f5 + 6b4d3ba commit a175489

File tree

11 files changed

+175
-116
lines changed

11 files changed

+175
-116
lines changed

.github/workflows/dependency_check.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/nightly.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Run check and build of the lib using the Bitcraze builder docker image
2+
name: Nightly Build
3+
4+
on:
5+
workflow_dispatch:
6+
schedule:
7+
- cron: '0 2 * * *'
8+
9+
jobs:
10+
build-and-test:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
os: [ubuntu-latest, lab-mac, windows-latest]
15+
python-version: ["3.10", "3.11", "3.12", "3.13"]
16+
17+
runs-on: ${{ matrix.os }}
18+
19+
steps:
20+
- name: Checkout repo
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Python ${{ matrix.python-version }}
24+
if: runner.os == 'Linux' || runner.os == 'Windows'
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
29+
- name: Set up Python ${{ matrix.python-version }} and venv on macOS
30+
if: runner.os == 'macOS'
31+
run: |
32+
brew install python@${{ matrix.python-version }}
33+
$(brew --prefix)/bin/python${{ matrix.python-version }} -m venv venv
34+
echo "PATH=$(pwd)/venv/bin:$PATH" >> $GITHUB_ENV
35+
36+
- name: Set up MSVC environment (Windows)
37+
uses: ilammy/msvc-dev-cmd@v1
38+
with:
39+
arch: x64
40+
if: runner.os == 'Windows'
41+
42+
- name: Install dependencies
43+
run: |
44+
python3 -m pip install --upgrade pip build setuptools
45+
python3 -m pip install pre-commit
46+
47+
- name: Code quality checks
48+
run: pre-commit run --all-files
49+
50+
- name: Build wheel
51+
run: python3 -m build --wheel
52+
53+
- name: Install the built wheel
54+
run: |
55+
# Find the built wheel
56+
WHEEL_FILE=$(ls dist/*.whl | head -n 1)
57+
echo "Installing wheel: $WHEEL_FILE"
58+
pip install "$WHEEL_FILE"
59+
shell: bash
60+
if: runner.os != 'Windows'
61+
62+
- name: Install the built wheel (Windows)
63+
run: |
64+
for /f %%i in ('dir /b dist\*.whl') do set WHEEL_FILE=dist\%%i
65+
echo Installing wheel: %WHEEL_FILE%
66+
pip install %WHEEL_FILE%
67+
shell: cmd
68+
if: runner.os == 'Windows'
69+
70+
- name: Test
71+
run: python3 -m unittest discover test/
72+
73+
build-docs:
74+
runs-on: ubuntu-latest
75+
steps:
76+
- name: Checkout repo
77+
uses: actions/checkout@v4
78+
- name: Setup Python
79+
uses: actions/setup-python@v5
80+
with:
81+
python-version: '3.x'
82+
- name: Install dependencies
83+
run: |
84+
python3 -m pip install --upgrade pip setuptools
85+
python3 -m pip install pdoc3 pyyaml
86+
- name: Build docs
87+
run: ./tools/build-docs/build-docs

.github/workflows/python-publish.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,16 @@ jobs:
1818
deploy:
1919

2020
runs-on: ubuntu-latest
21+
environment:
22+
name: pypi
23+
url: https://pypi.org/p/cflib
24+
permissions:
25+
id-token: write
2126

2227
steps:
2328
- uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
2431
- name: Set up Python
2532
uses: actions/setup-python@v4
2633
with:
@@ -34,5 +41,4 @@ jobs:
3441
- name: Publish package
3542
uses: pypa/gh-action-pypi-publish@release/v1
3643
with:
37-
username: __token__
38-
password: ${{ secrets.PYPI_TOKEN }}
44+
verbose: true

.github/workflows/test-python-publish.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,16 @@ jobs:
1818
deploy:
1919

2020
runs-on: ubuntu-latest
21+
environment:
22+
name: pypi-test
23+
url: https://pypi.org/p/cflib
24+
permissions:
25+
id-token: write
2126

2227
steps:
2328
- uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
2431
- name: Set up Python
2532
uses: actions/setup-python@v4
2633
with:
@@ -34,6 +41,5 @@ jobs:
3441
- name: Publish package to TestPyPI
3542
uses: pypa/gh-action-pypi-publish@release/v1
3643
with:
37-
username: __token__
38-
password: ${{ secrets.PYPI_TEST_TOKEN }}
39-
repository_url: https://test.pypi.org/legacy/
44+
repository-url: https://test.pypi.org/legacy/
45+
verbose: true

cflib/crazyflie/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def __init__(self, link=None, ro_cache=None, rw_cache=None):
109109
rw_cache=rw_cache)
110110

111111
self.incoming = _IncomingPacketHandler(self)
112-
self.incoming.setDaemon(True)
112+
self.incoming.daemon = True
113113
if self.link:
114114
self.incoming.start()
115115

cflib/crazyflie/param.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ class _ExtendedTypeFetcher(Thread):
520520

521521
def __init__(self, cf, toc):
522522
Thread.__init__(self)
523-
self.setDaemon(True)
523+
self.daemon = True
524524
self._lock = Lock()
525525

526526
self._cf = cf
@@ -599,7 +599,7 @@ class _ParamUpdater(Thread):
599599
def __init__(self, cf, useV2, updated_callback):
600600
"""Initialize the thread"""
601601
Thread.__init__(self)
602-
self.setDaemon(True)
602+
self.daemon = True
603603
self.wait_lock = Lock()
604604
self.cf = cf
605605
self._useV2 = useV2

docs/installation/install.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ page_id: install
77

88
This project requires Python 3.10+.
99

10+
To install on Python 3.13, build tools and Python development headers are required.
1011

1112
See below sections for more platform-specific requirements.
1213
## Install from Source
@@ -78,6 +79,8 @@ With linux, the crazyradio is easily recognized, but you have to setup UDEVpermi
7879

7980
Look at the [Zadig crazyradio instructions](https://www.bitcraze.io/documentation/repository/crazyradio-firmware/master/building/usbwindows/) to install crazyradio on Windows
8081

82+
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.
83+
8184
### macOS
8285
If you are using python 3.12 on mac you need to install libusb using homebrew.
8386
```

pyproject.toml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0", "wheel", "setuptools_scm"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "cflib"
7+
dynamic = ["version"]
8+
description = "Crazyflie Python driver"
9+
authors = [
10+
{ name = "Bitcraze and contributors", email = "contact@bitcraze.io" },
11+
]
12+
13+
readme = {file = "README.md", content-type = "text/markdown"}
14+
license = { text = "GPLv3" }
15+
keywords = ["driver", "crazyflie", "quadcopter"]
16+
17+
classifiers = [
18+
"Development Status :: 5 - Production/Stable",
19+
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
20+
"Topic :: System :: Hardware :: Hardware Drivers",
21+
"Topic :: Scientific/Engineering :: Robotics",
22+
"Intended Audience :: Science/Research",
23+
"Intended Audience :: Education",
24+
"Intended Audience :: Developers",
25+
"Operating System :: Linux",
26+
"Operating System :: MacOS",
27+
"Operating System :: Microsoft :: Windows",
28+
29+
# Supported Python versions
30+
"Programming Language :: Python :: 3.10",
31+
"Programming Language :: Python :: 3.11",
32+
"Programming Language :: Python :: 3.12",
33+
"Programming Language :: Python :: 3.13",
34+
]
35+
requires-python = ">= 3.10"
36+
37+
dependencies = [
38+
"pyusb~=1.2",
39+
"libusb-package~=1.0",
40+
"scipy~=1.14",
41+
"numpy~=1.26",
42+
"packaging~=24.2",
43+
]
44+
45+
[project.urls]
46+
Homepage = "https://www.bitcraze.io"
47+
Documentation = "https://www.bitcraze.io/documentation/repository/crazyflie-lib-python/master/"
48+
Repository = "https://github.com/bitcraze/crazyflie-lib-python"
49+
Issues = "https://github.com/bitcraze/crazyflie-lib-python/issues"
50+
51+
[project.optional-dependencies]
52+
dev = ["pre-commit"]
53+
54+
[tool.setuptools]
55+
include-package-data = true
56+
57+
[tool.setuptools.packages]
58+
find = { exclude = ["examples", "test"] }
59+
60+
[tool.setuptools.package-data]
61+
"cflib.resources.binaries" = ["cflib/resources/binaries/*.bin"]
62+
63+
[tool.setuptools_scm]
64+
version_scheme = "no-guess-dev"

setup.cfg

Lines changed: 0 additions & 2 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)