From f3db1bb8654376f1e02a9470e9e754cee7f1248c Mon Sep 17 00:00:00 2001 From: David Lechner Date: Wed, 9 Aug 2023 13:47:55 -0500 Subject: [PATCH 01/10] use PEP 688 collections.abc.Buffer for type hints Python 3.12 introduces a new type to indicate the C buffer protocol. We can use this to more correctly indicate allowable types. --- CHANGELOG.rst | 1 + bleak/__init__.py | 11 +++++++---- bleak/backends/bluezdbus/client.py | 15 +++++++++------ bleak/backends/client.py | 16 ++++++++++------ bleak/backends/corebluetooth/client.py | 16 ++++++++++------ bleak/backends/winrt/client.py | 21 ++++++++++++--------- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 8 files changed, 54 insertions(+), 36 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 23ccc435..735ab3d7 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -26,6 +26,7 @@ Changed * Added missing permissions and requirements in android kivy example. Fixes #1184. * Bleak recipe now automatically installs bleak from github release. * Changed `BlueZManager` methods to raise `BleakError` when device is not in BlueZ. +* Changed type hint for buffer protocol to ``collections.abc.Buffer``. Fixed ----- diff --git a/bleak/__init__.py b/bleak/__init__.py index 852b32aa..b6be9dd4 100644 --- a/bleak/__init__.py +++ b/bleak/__init__.py @@ -31,6 +31,11 @@ ) from warnings import warn +if sys.version_info < (3, 12): + from typing_extensions import Buffer +else: + from collections.abc import Buffer + if sys.version_info < (3, 11): from async_timeout import timeout as async_timeout else: @@ -671,7 +676,7 @@ async def read_gatt_char( async def write_gatt_char( self, char_specifier: Union[BleakGATTCharacteristic, int, str, uuid.UUID], - data: Union[bytes, bytearray, memoryview], + data: Buffer, response: bool = None, ) -> None: """ @@ -822,9 +827,7 @@ async def read_gatt_descriptor(self, handle: int, **kwargs) -> bytearray: """ return await self._backend.read_gatt_descriptor(handle, **kwargs) - async def write_gatt_descriptor( - self, handle: int, data: Union[bytes, bytearray, memoryview] - ) -> None: + async def write_gatt_descriptor(self, handle: int, data: Buffer) -> None: """ Perform a write operation on the specified GATT descriptor. diff --git a/bleak/backends/bluezdbus/client.py b/bleak/backends/bluezdbus/client.py index b7a268c2..d1ee0733 100644 --- a/bleak/backends/bluezdbus/client.py +++ b/bleak/backends/bluezdbus/client.py @@ -10,6 +10,11 @@ from typing import Callable, Dict, Optional, Set, Union, cast from uuid import UUID +if sys.version_info < (3, 12): + from typing_extensions import Buffer +else: + from collections.abc import Buffer + if sys.version_info < (3, 11): from async_timeout import timeout as async_timeout else: @@ -812,7 +817,7 @@ async def read_gatt_descriptor(self, handle: int, **kwargs) -> bytearray: async def write_gatt_char( self, characteristic: BleakGATTCharacteristic, - data: Union[bytes, bytearray, memoryview], + data: Buffer, response: bool, ) -> None: if not self.is_connected: @@ -883,14 +888,12 @@ async def write_gatt_char( data, ) - async def write_gatt_descriptor( - self, handle: int, data: Union[bytes, bytearray, memoryview] - ) -> None: + async def write_gatt_descriptor(self, handle: int, data: Buffer) -> None: """Perform a write operation on the specified GATT descriptor. Args: - handle (int): The handle of the descriptor to read from. - data (bytes or bytearray): The data to send. + handle: The handle of the descriptor to read from. + data: The data to send (any bytes-like object). """ if not self.is_connected: diff --git a/bleak/backends/client.py b/bleak/backends/client.py index 6a5da4fd..307753e5 100644 --- a/bleak/backends/client.py +++ b/bleak/backends/client.py @@ -9,10 +9,16 @@ import asyncio import os import platform +import sys import uuid from typing import Callable, Optional, Type, Union from warnings import warn +if sys.version_info < (3, 12): + from typing_extensions import Buffer +else: + from collections.abc import Buffer + from ..exc import BleakError from .service import BleakGATTServiceCollection from .characteristic import BleakGATTCharacteristic @@ -184,7 +190,7 @@ async def read_gatt_descriptor(self, handle: int, **kwargs) -> bytearray: async def write_gatt_char( self, characteristic: BleakGATTCharacteristic, - data: Union[bytes, bytearray, memoryview], + data: Buffer, response: bool, ) -> None: """ @@ -198,14 +204,12 @@ async def write_gatt_char( raise NotImplementedError() @abc.abstractmethod - async def write_gatt_descriptor( - self, handle: int, data: Union[bytes, bytearray, memoryview] - ) -> None: + async def write_gatt_descriptor(self, handle: int, data: Buffer) -> None: """Perform a write operation on the specified GATT descriptor. Args: - handle (int): The handle of the descriptor to read from. - data (bytes or bytearray): The data to send. + handle: The handle of the descriptor to read from. + data: The data to send (any bytes-like object). """ raise NotImplementedError() diff --git a/bleak/backends/corebluetooth/client.py b/bleak/backends/corebluetooth/client.py index ae23ee70..c27aeabf 100644 --- a/bleak/backends/corebluetooth/client.py +++ b/bleak/backends/corebluetooth/client.py @@ -5,9 +5,15 @@ """ import asyncio import logging +import sys import uuid from typing import Optional, Set, Union +if sys.version_info < (3, 12): + from typing_extensions import Buffer +else: + from collections.abc import Buffer + from CoreBluetooth import ( CBUUID, CBCharacteristicWriteWithoutResponse, @@ -308,7 +314,7 @@ async def read_gatt_descriptor( async def write_gatt_char( self, characteristic: BleakGATTCharacteristic, - data: Union[bytes, bytearray, memoryview], + data: Buffer, response: bool, ) -> None: value = NSData.alloc().initWithBytes_length_(data, len(data)) @@ -321,14 +327,12 @@ async def write_gatt_char( ) logger.debug(f"Write Characteristic {characteristic.uuid} : {data}") - async def write_gatt_descriptor( - self, handle: int, data: Union[bytes, bytearray, memoryview] - ) -> None: + async def write_gatt_descriptor(self, handle: int, data: Buffer) -> None: """Perform a write operation on the specified GATT descriptor. Args: - handle (int): The handle of the descriptor to read from. - data (bytes or bytearray): The data to send. + handle: The handle of the descriptor to read from. + data: The data to send (any bytes-like object). """ descriptor = self.services.get_descriptor(handle) diff --git a/bleak/backends/winrt/client.py b/bleak/backends/winrt/client.py index 0b4bb628..6f5455d5 100644 --- a/bleak/backends/winrt/client.py +++ b/bleak/backends/winrt/client.py @@ -13,6 +13,11 @@ from ctypes import WinError from typing import Any, Dict, List, Optional, Sequence, Set, Union, cast +if sys.version_info < (3, 12): + from typing_extensions import Buffer +else: + from collections.abc import Buffer + if sys.version_info < (3, 11): from async_timeout import timeout as async_timeout else: @@ -53,7 +58,7 @@ EventRegistrationToken, IAsyncOperation, ) -from bleak_winrt.windows.storage.streams import Buffer +from bleak_winrt.windows.storage.streams import Buffer as WinBuffer from ... import BleakScanner from ...exc import PROTOCOL_ERROR_CODES, BleakDeviceNotFoundError, BleakError @@ -836,7 +841,7 @@ async def read_gatt_descriptor(self, handle: int, **kwargs) -> bytearray: async def write_gatt_char( self, characteristic: BleakGATTCharacteristic, - data: Union[bytes, bytearray, memoryview], + data: Buffer, response: bool, ) -> None: if not self.is_connected: @@ -847,7 +852,7 @@ async def write_gatt_char( if response else GattWriteOption.WRITE_WITHOUT_RESPONSE ) - buf = Buffer(len(data)) + buf = WinBuffer(len(data)) buf.length = buf.capacity with memoryview(buf) as mv: mv[:] = data @@ -857,14 +862,12 @@ async def write_gatt_char( f"Could not write value {data} to characteristic {characteristic.handle:04X}", ) - async def write_gatt_descriptor( - self, handle: int, data: Union[bytes, bytearray, memoryview] - ) -> None: + async def write_gatt_descriptor(self, handle: int, data: Buffer) -> None: """Perform a write operation on the specified GATT descriptor. Args: - handle (int): The handle of the descriptor to read from. - data (bytes or bytearray): The data to send. + handle: The handle of the descriptor to read from. + data: The data to send (any bytes-like object). """ if not self.is_connected: @@ -874,7 +877,7 @@ async def write_gatt_descriptor( if not descriptor: raise BleakError(f"Descriptor with handle {handle} was not found!") - buf = Buffer(len(data)) + buf = WinBuffer(len(data)) buf.length = buf.capacity with memoryview(buf) as mv: mv[:] = data diff --git a/poetry.lock b/poetry.lock index 1c8a0de7..e35ecddd 100644 --- a/poetry.lock +++ b/poetry.lock @@ -939,13 +939,13 @@ files = [ [[package]] name = "typing-extensions" -version = "4.3.0" +version = "4.7.1" description = "Backported and Experimental Type Hints for Python 3.7+" optional = false python-versions = ">=3.7" files = [ - {file = "typing_extensions-4.3.0-py3-none-any.whl", hash = "sha256:25642c956049920a5aa49edcdd6ab1e06d7e5d467fc00e0506c44ac86fbfca02"}, - {file = "typing_extensions-4.3.0.tar.gz", hash = "sha256:e6d2677a32f47fc7eb2795db1dd15c1f34eff616bcaf2cfb5e997f854fa1c4a6"}, + {file = "typing_extensions-4.7.1-py3-none-any.whl", hash = "sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36"}, + {file = "typing_extensions-4.7.1.tar.gz", hash = "sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2"}, ] [[package]] @@ -982,4 +982,4 @@ testing = ["func-timeout", "jaraco.itertools", "pytest (>=6)", "pytest-black (>= [metadata] lock-version = "2.0" python-versions = "^3.7" -content-hash = "140c9c2d6407cbee7866fba10daa0b9db4138a3aadab89e1c06a20c28095c482" +content-hash = "15f2471def826aaaf402f7457ff40a9a5e4e02c8212e39988af1c19b5fad90cc" diff --git a/pyproject.toml b/pyproject.toml index 94123f96..982a2e96 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ classifiers = [ [tool.poetry.dependencies] python = "^3.7" async-timeout = { version = ">= 3.0.0, < 5", python = "<3.11" } -typing-extensions = { version = "^4.2.0", python = "<3.8" } +typing-extensions = { version = ">=4.7.0", python = "<3.12" } pyobjc-core = { version = "^9.0.1", markers = "platform_system=='Darwin'" } pyobjc-framework-CoreBluetooth = { version = "^9.0.1", markers = "platform_system=='Darwin'" } pyobjc-framework-libdispatch = { version = "^9.0.1", markers = "platform_system=='Darwin'" } From e1a9a6f88424eade3607edb17410cee8cdd6e6d3 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Wed, 9 Aug 2023 14:10:38 -0500 Subject: [PATCH 02/10] drop support for Python 3.7 Python 3.7 has reached end of life. --- .github/pull_request_template.md | 2 +- .github/workflows/build_and_test.yml | 2 +- CHANGELOG.rst | 4 ++ CONTRIBUTING.rst | 2 +- bleak/__init__.py | 5 +- bleak/backends/bluezdbus/defs.py | 8 +-- bleak/backends/bluezdbus/scanner.py | 8 +-- bleak/backends/corebluetooth/scanner.py | 8 +-- bleak/backends/p4android/scanner.py | 7 +-- bleak/backends/winrt/client.py | 29 +++++---- bleak/backends/winrt/scanner.py | 8 +-- poetry.lock | 59 +------------------ pyproject.toml | 7 +-- .../bleak/backends/bluezdbus/test_version.py | 8 +-- 14 files changed, 37 insertions(+), 120 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 28918d22..33e3fb6e 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -6,7 +6,7 @@ Before you submit a pull request, check that it meets these guidelines: 1. If the pull request adds functionality, the docs should be updated. 2. Modify the `CHANGELOG.rst`, describing your changes as is specified by the guidelines in that document. -3. The pull request should work for Python 3.7+ on the following platforms: +3. The pull request should work for Python 3.8+ on the following platforms: - Windows 10, version 16299 (Fall Creators Update) and greater - Linux distributions with BlueZ >= 5.43 - OS X / macOS >= 10.11 diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index ea19753b..e7266056 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11'] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 735ab3d7..d7cd7ea4 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -39,6 +39,10 @@ Fixed * Optimize BlueZ backend device watchers and condition callbacks to avoid linear searches * Fixed WinRT backend sometimes hanging forever when a device goes out of range during connection. Fixes #1359. +Removed +------- +Dropped support for Python 3.7. + `0.20.2`_ (2023-04-19) ====================== diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 6e437bcc..9299ac6f 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -101,7 +101,7 @@ Before you submit a pull request, check that it meets these guidelines: 1. If the pull request adds functionality, the docs should be updated. 2. Modify the ``CHANGELOG.rst``, describing your changes as is specified by the guidelines in that document. -3. The pull request should work for Python 3.7+ on the following platforms: +3. The pull request should work for Python 3.8+ on the following platforms: - Windows 10, version 16299 (Fall Creators Update) and greater - Linux distributions with BlueZ >= 5.43 - OS X / macOS >= 10.11 diff --git a/bleak/__init__.py b/bleak/__init__.py index b6be9dd4..8a467203 100644 --- a/bleak/__init__.py +++ b/bleak/__init__.py @@ -30,6 +30,7 @@ overload, ) from warnings import warn +from typing import Literal if sys.version_info < (3, 12): from typing_extensions import Buffer @@ -41,10 +42,6 @@ else: from asyncio import timeout as async_timeout -if sys.version_info[:2] < (3, 8): - from typing_extensions import Literal -else: - from typing import Literal from .backends.characteristic import BleakGATTCharacteristic from .backends.client import BaseBleakClient, get_platform_client_backend_type diff --git a/bleak/backends/bluezdbus/defs.py b/bleak/backends/bluezdbus/defs.py index 8ec19af2..50054540 100644 --- a/bleak/backends/bluezdbus/defs.py +++ b/bleak/backends/bluezdbus/defs.py @@ -1,12 +1,6 @@ # -*- coding: utf-8 -*- -import sys -from typing import Dict, List, Tuple - -if sys.version_info[:2] < (3, 8): - from typing_extensions import Literal, TypedDict -else: - from typing import Literal, TypedDict +from typing import Dict, List, Literal, Tuple, TypedDict # DBus Interfaces OBJECT_MANAGER_INTERFACE = "org.freedesktop.DBus.ObjectManager" diff --git a/bleak/backends/bluezdbus/scanner.py b/bleak/backends/bluezdbus/scanner.py index 4f0bdbe8..24591398 100644 --- a/bleak/backends/bluezdbus/scanner.py +++ b/bleak/backends/bluezdbus/scanner.py @@ -1,15 +1,9 @@ import logging -import sys -from typing import Callable, Coroutine, Dict, List, Optional +from typing import Callable, Coroutine, Dict, List, Literal, Optional, TypedDict from warnings import warn from dbus_fast import Variant -if sys.version_info[:2] < (3, 8): - from typing_extensions import Literal, TypedDict -else: - from typing import Literal, TypedDict - from ...exc import BleakError from ..scanner import AdvertisementData, AdvertisementDataCallback, BaseBleakScanner from .advertisement_monitor import OrPatternLike diff --git a/bleak/backends/corebluetooth/scanner.py b/bleak/backends/corebluetooth/scanner.py index b3ef1603..e6d20c2d 100644 --- a/bleak/backends/corebluetooth/scanner.py +++ b/bleak/backends/corebluetooth/scanner.py @@ -1,11 +1,5 @@ import logging -import sys -from typing import Any, Dict, List, Optional - -if sys.version_info[:2] < (3, 8): - from typing_extensions import Literal, TypedDict -else: - from typing import Literal, TypedDict +from typing import Any, Dict, List, Literal, Optional, TypedDict import objc from CoreBluetooth import CBPeripheral diff --git a/bleak/backends/p4android/scanner.py b/bleak/backends/p4android/scanner.py index 496034c4..e53662f6 100644 --- a/bleak/backends/p4android/scanner.py +++ b/bleak/backends/p4android/scanner.py @@ -4,18 +4,13 @@ import logging import sys import warnings -from typing import List, Optional +from typing import List, Literal, Optional if sys.version_info < (3, 11): from async_timeout import timeout as async_timeout else: from asyncio import timeout as async_timeout -if sys.version_info[:2] < (3, 8): - from typing_extensions import Literal -else: - from typing import Literal - from android.broadcast import BroadcastReceiver from android.permissions import Permission, request_permissions from jnius import cast, java_method diff --git a/bleak/backends/winrt/client.py b/bleak/backends/winrt/client.py index 6f5455d5..882fb696 100644 --- a/bleak/backends/winrt/client.py +++ b/bleak/backends/winrt/client.py @@ -11,7 +11,19 @@ import uuid import warnings from ctypes import WinError -from typing import Any, Dict, List, Optional, Sequence, Set, Union, cast +from typing import ( + Any, + Dict, + List, + Literal, + Optional, + Protocol, + Sequence, + Set, + TypedDict, + Union, + cast, +) if sys.version_info < (3, 12): from typing_extensions import Buffer @@ -23,11 +35,6 @@ else: from asyncio import timeout as async_timeout -if sys.version_info[:2] < (3, 8): - from typing_extensions import Literal, TypedDict -else: - from typing import Literal, TypedDict - from bleak_winrt.windows.devices.bluetooth import ( BluetoothAddressType, BluetoothCacheMode, @@ -73,10 +80,10 @@ logger = logging.getLogger(__name__) -# TODO: we can use this when minimum Python is 3.8 -# class _Result(typing.Protocol): -# status: GattCommunicationStatus -# protocol_error: typing.Optional[int] + +class _Result(Protocol): + status: GattCommunicationStatus + protocol_error: int def _address_to_int(address: str) -> int: @@ -95,7 +102,7 @@ def _address_to_int(address: str) -> int: return int(address, base=16) -def _ensure_success(result: Any, attr: Optional[str], fail_msg: str) -> Any: +def _ensure_success(result: _Result, attr: Optional[str], fail_msg: str) -> Any: """ Ensures that *status* is ``GattCommunicationStatus.SUCCESS``, otherwise raises ``BleakError``. diff --git a/bleak/backends/winrt/scanner.py b/bleak/backends/winrt/scanner.py index 8c81df55..acb02f52 100644 --- a/bleak/backends/winrt/scanner.py +++ b/bleak/backends/winrt/scanner.py @@ -1,7 +1,6 @@ import asyncio import logging -import sys -from typing import Dict, List, NamedTuple, Optional +from typing import Dict, List, Literal, NamedTuple, Optional from uuid import UUID from bleak_winrt.windows.devices.bluetooth.advertisement import ( @@ -12,11 +11,6 @@ BluetoothLEScanningMode, ) -if sys.version_info[:2] < (3, 8): - from typing_extensions import Literal -else: - from typing import Literal - from ...assigned_numbers import AdvertisementDataType from ...uuids import normalize_uuid_str from ..scanner import AdvertisementData, AdvertisementDataCallback, BaseBleakScanner diff --git a/poetry.lock b/poetry.lock index e35ecddd..029b2713 100644 --- a/poetry.lock +++ b/poetry.lock @@ -22,20 +22,6 @@ files = [ {file = "async_timeout-4.0.2-py3-none-any.whl", hash = "sha256:8ca1e4fcf50d07413d66d1a5e416e42cfdf5851c981d679a09851a6853383b3c"}, ] -[package.dependencies] -typing-extensions = {version = ">=3.6.5", markers = "python_version < \"3.8\""} - -[[package]] -name = "asynctest" -version = "0.13.0" -description = "Enhance the standard unittest package with features for testing asyncio libraries" -optional = false -python-versions = ">=3.5" -files = [ - {file = "asynctest-0.13.0-py3-none-any.whl", hash = "sha256:5da6118a7e6d6b54d83a8f7197769d046922a44d2a99c21382f0a6e4fadae676"}, - {file = "asynctest-0.13.0.tar.gz", hash = "sha256:c27862842d15d83e6a34eb0b2866c323880eb3a75e4485b079ea11748fd77fac"}, -] - [[package]] name = "attrs" version = "22.1.0" @@ -105,7 +91,6 @@ mypy-extensions = ">=0.4.3" pathspec = ">=0.9.0" platformdirs = ">=2" tomli = {version = ">=1.1.0", markers = "python_full_version < \"3.11.0a7\""} -typed-ast = {version = ">=1.4.2", markers = "python_version < \"3.8\" and implementation_name == \"cpython\""} typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""} [package.extras] @@ -172,7 +157,6 @@ files = [ [package.dependencies] colorama = {version = "*", markers = "platform_system == \"Windows\""} -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} [[package]] name = "colorama" @@ -351,7 +335,6 @@ files = [ ] [package.dependencies] -typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} zipp = ">=0.5" [package.extras] @@ -509,9 +492,6 @@ files = [ {file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"}, ] -[package.dependencies] -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} - [package.extras] dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] @@ -662,7 +642,6 @@ files = [ [package.dependencies] attrs = ">=19.2.0" colorama = {version = "*", markers = "sys_platform == \"win32\""} -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} iniconfig = "*" packaging = "*" pluggy = ">=0.12,<2.0" @@ -685,7 +664,6 @@ files = [ [package.dependencies] pytest = ">=6.1.0" -typing-extensions = {version = ">=3.7.2", markers = "python_version < \"3.8\""} [package.extras] testing = ["coverage (>=6.2)", "flaky (>=3.5.0)", "hypothesis (>=5.7.1)", "mypy (>=0.931)", "pytest-trio (>=0.7.0)"] @@ -904,39 +882,6 @@ files = [ {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, ] -[[package]] -name = "typed-ast" -version = "1.5.4" -description = "a fork of Python 2 and 3 ast modules with type comment support" -optional = false -python-versions = ">=3.6" -files = [ - {file = "typed_ast-1.5.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:669dd0c4167f6f2cd9f57041e03c3c2ebf9063d0757dc89f79ba1daa2bfca9d4"}, - {file = "typed_ast-1.5.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:211260621ab1cd7324e0798d6be953d00b74e0428382991adfddb352252f1d62"}, - {file = "typed_ast-1.5.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:267e3f78697a6c00c689c03db4876dd1efdfea2f251a5ad6555e82a26847b4ac"}, - {file = "typed_ast-1.5.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c542eeda69212fa10a7ada75e668876fdec5f856cd3d06829e6aa64ad17c8dfe"}, - {file = "typed_ast-1.5.4-cp310-cp310-win_amd64.whl", hash = "sha256:a9916d2bb8865f973824fb47436fa45e1ebf2efd920f2b9f99342cb7fab93f72"}, - {file = "typed_ast-1.5.4-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:79b1e0869db7c830ba6a981d58711c88b6677506e648496b1f64ac7d15633aec"}, - {file = "typed_ast-1.5.4-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a94d55d142c9265f4ea46fab70977a1944ecae359ae867397757d836ea5a3f47"}, - {file = "typed_ast-1.5.4-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:183afdf0ec5b1b211724dfef3d2cad2d767cbefac291f24d69b00546c1837fb6"}, - {file = "typed_ast-1.5.4-cp36-cp36m-win_amd64.whl", hash = "sha256:639c5f0b21776605dd6c9dbe592d5228f021404dafd377e2b7ac046b0349b1a1"}, - {file = "typed_ast-1.5.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:cf4afcfac006ece570e32d6fa90ab74a17245b83dfd6655a6f68568098345ff6"}, - {file = "typed_ast-1.5.4-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ed855bbe3eb3715fca349c80174cfcfd699c2f9de574d40527b8429acae23a66"}, - {file = "typed_ast-1.5.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:6778e1b2f81dfc7bc58e4b259363b83d2e509a65198e85d5700dfae4c6c8ff1c"}, - {file = "typed_ast-1.5.4-cp37-cp37m-win_amd64.whl", hash = "sha256:0261195c2062caf107831e92a76764c81227dae162c4f75192c0d489faf751a2"}, - {file = "typed_ast-1.5.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2efae9db7a8c05ad5547d522e7dbe62c83d838d3906a3716d1478b6c1d61388d"}, - {file = "typed_ast-1.5.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7d5d014b7daa8b0bf2eaef684295acae12b036d79f54178b92a2b6a56f92278f"}, - {file = "typed_ast-1.5.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:370788a63915e82fd6f212865a596a0fefcbb7d408bbbb13dea723d971ed8bdc"}, - {file = "typed_ast-1.5.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:4e964b4ff86550a7a7d56345c7864b18f403f5bd7380edf44a3c1fb4ee7ac6c6"}, - {file = "typed_ast-1.5.4-cp38-cp38-win_amd64.whl", hash = "sha256:683407d92dc953c8a7347119596f0b0e6c55eb98ebebd9b23437501b28dcbb8e"}, - {file = "typed_ast-1.5.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4879da6c9b73443f97e731b617184a596ac1235fe91f98d279a7af36c796da35"}, - {file = "typed_ast-1.5.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3e123d878ba170397916557d31c8f589951e353cc95fb7f24f6bb69adc1a8a97"}, - {file = "typed_ast-1.5.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ebd9d7f80ccf7a82ac5f88c521115cc55d84e35bf8b446fcd7836eb6b98929a3"}, - {file = "typed_ast-1.5.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:98f80dee3c03455e92796b58b98ff6ca0b2a6f652120c263efdba4d6c5e58f72"}, - {file = "typed_ast-1.5.4-cp39-cp39-win_amd64.whl", hash = "sha256:0fdbcf2fef0ca421a3f5912555804296f0b0960f0418c440f5d6d3abb549f3e1"}, - {file = "typed_ast-1.5.4.tar.gz", hash = "sha256:39e21ceb7388e4bb37f4c679d72707ed46c2fbf2a5609b8b8ebc4b067d977df2"}, -] - [[package]] name = "typing-extensions" version = "4.7.1" @@ -981,5 +926,5 @@ testing = ["func-timeout", "jaraco.itertools", "pytest (>=6)", "pytest-black (>= [metadata] lock-version = "2.0" -python-versions = "^3.7" -content-hash = "15f2471def826aaaf402f7457ff40a9a5e4e02c8212e39988af1c19b5fad90cc" +python-versions = "^3.8" +content-hash = "5f227d158a9bd163e028e1ae0af8074ffa712cd07fea2b8d628e98e37a65e3f8" diff --git a/pyproject.toml b/pyproject.toml index 982a2e96..bd3a1166 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ classifiers = [ "Issues" = "https://github.com/hbldh/bleak/issues" [tool.poetry.dependencies] -python = "^3.7" +python = "^3.8" async-timeout = { version = ">= 3.0.0, < 5", python = "<3.11" } typing-extensions = { version = ">=4.7.0", python = "<3.12" } pyobjc-core = { version = "^9.0.1", markers = "platform_system=='Darwin'" } @@ -32,15 +32,14 @@ bleak-winrt = { version = "^1.2.0", markers = "platform_system=='Windows'" } dbus-fast = { version = "^1.83.0", markers = "platform_system == 'Linux'" } [tool.poetry.group.docs.dependencies] -Sphinx = { version = "^5.1.1", python = ">=3.8" } +Sphinx = "^5.1.1" sphinx-rtd-theme = "^1.0.0" [tool.poetry.group.lint.dependencies] black = "^22.1.0" -flake8 = { version = "^5.0.0", python = ">=3.8" } +flake8 = "^5.0.0" [tool.poetry.group.test.dependencies] -asynctest = { version = "^0.13.0", python = "<3.8" } pytest = "^7.0.0" pytest-asyncio = "^0.19.0" pytest-cov = "^3.0.0 " diff --git a/tests/bleak/backends/bluezdbus/test_version.py b/tests/bleak/backends/bluezdbus/test_version.py index afe3f1dc..6f36b7f5 100644 --- a/tests/bleak/backends/bluezdbus/test_version.py +++ b/tests/bleak/backends/bluezdbus/test_version.py @@ -2,16 +2,10 @@ """Tests for `bleak.backends.bluezdbus.version` package.""" -import sys -from unittest.mock import Mock, patch +from unittest.mock import AsyncMock, Mock, patch import pytest -if sys.version_info[:2] < (3, 8): - from asynctest.mock import CoroutineMock as AsyncMock -else: - from unittest.mock import AsyncMock - from bleak.backends.bluezdbus.version import BlueZFeatures From e3af198b67d63b750e33fd76f4829fca6bf7b73b Mon Sep 17 00:00:00 2001 From: David Lechner Date: Wed, 9 Aug 2023 14:14:46 -0500 Subject: [PATCH 03/10] update PyObjC version to 9.2 This ensures we get support for Python 3.12. --- poetry.lock | 71 ++++++++++++++++++++++++++------------------------ pyproject.toml | 6 ++--- 2 files changed, 40 insertions(+), 37 deletions(-) diff --git a/poetry.lock b/poetry.lock index 029b2713..b431dfc4 100644 --- a/poetry.lock +++ b/poetry.lock @@ -545,74 +545,77 @@ plugins = ["importlib-metadata"] [[package]] name = "pyobjc-core" -version = "9.0.1" +version = "9.2" description = "Python<->ObjC Interoperability Module" optional = false python-versions = ">=3.7" files = [ - {file = "pyobjc-core-9.0.1.tar.gz", hash = "sha256:5ce1510bb0bdff527c597079a42b2e13a19b7592e76850be7960a2775b59c929"}, - {file = "pyobjc_core-9.0.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:b614406d46175b1438a9596b664bf61952323116704d19bc1dea68052a0aad98"}, - {file = "pyobjc_core-9.0.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:bd397e729f6271c694fb70df8f5d3d3c9b2f2b8ac02fbbdd1757ca96027b94bb"}, - {file = "pyobjc_core-9.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:d919934eaa6d1cf1505ff447a5c2312be4c5651efcb694eb9f59e86f5bd25e6b"}, - {file = "pyobjc_core-9.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:67d67ca8b164f38ceacce28a18025845c3ec69613f3301935d4d2c4ceb22e3fd"}, - {file = "pyobjc_core-9.0.1-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:39d11d71f6161ac0bd93cffc8ea210bb0178b56d16a7408bf74283d6ecfa7430"}, - {file = "pyobjc_core-9.0.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:25be1c4d530e473ed98b15063b8d6844f0733c98914de6f09fe1f7652b772bbc"}, + {file = "pyobjc-core-9.2.tar.gz", hash = "sha256:d734b9291fec91ff4e3ae38b9c6839debf02b79c07314476e87da8e90b2c68c3"}, + {file = "pyobjc_core-9.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:fa674a39949f5cde8e5c7bbcd24496446bfc67592b028aedbec7f81dc5fc4daa"}, + {file = "pyobjc_core-9.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:bbc8de304ee322a1ee530b4d2daca135a49b4a49aa3cedc6b2c26c43885f4842"}, + {file = "pyobjc_core-9.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:0fa950f092673883b8bd28bc18397415cabb457bf410920762109b411789ade9"}, + {file = "pyobjc_core-9.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:586e4cae966282eaa61b21cae66ccdcee9d69c036979def26eebdc08ddebe20f"}, + {file = "pyobjc_core-9.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:41189c2c680931c0395a55691763c481fc681f454f21bb4f1644f98c24a45954"}, + {file = "pyobjc_core-9.2-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:2d23ee539f2ba5e9f5653d75a13f575c7e36586fc0086792739e69e4c2617eda"}, + {file = "pyobjc_core-9.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:b9809cf96678797acb72a758f34932fe8e2602d5ab7abec15c5ac68ddb481720"}, ] [[package]] name = "pyobjc-framework-cocoa" -version = "9.0.1" +version = "9.2" description = "Wrappers for the Cocoa frameworks on macOS" optional = false python-versions = ">=3.7" files = [ - {file = "pyobjc-framework-Cocoa-9.0.1.tar.gz", hash = "sha256:a8b53b3426f94307a58e2f8214dc1094c19afa9dcb96f21be12f937d968b2df3"}, - {file = "pyobjc_framework_Cocoa-9.0.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:5f94b0f92a62b781e633e58f09bcaded63d612f9b1e15202f5f372ea59e4aebd"}, - {file = "pyobjc_framework_Cocoa-9.0.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:f062c3bb5cc89902e6d164aa9a66ffc03638645dd5f0468b6f525ac997c86e51"}, - {file = "pyobjc_framework_Cocoa-9.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0b374c0a9d32ba4fc5610ab2741cb05a005f1dfb82a47dbf2dbb2b3a34b73ce5"}, - {file = "pyobjc_framework_Cocoa-9.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:8928080cebbce91ac139e460d3dfc94c7cb6935be032dcae9c0a51b247f9c2d9"}, - {file = "pyobjc_framework_Cocoa-9.0.1-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:9d2bd86a0a98d906f762f5dc59f2fc67cce32ae9633b02ff59ac8c8a33dd862d"}, - {file = "pyobjc_framework_Cocoa-9.0.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:2a41053cbcee30e1e8914efa749c50b70bf782527d5938f2bc2a6393740969ce"}, + {file = "pyobjc-framework-Cocoa-9.2.tar.gz", hash = "sha256:efd78080872d8c8de6c2b97e0e4eac99d6203a5d1637aa135d071d464eb2db53"}, + {file = "pyobjc_framework_Cocoa-9.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:9e02d8a7cc4eb7685377c50ba4f17345701acf4c05b1e7480d421bff9e2f62a4"}, + {file = "pyobjc_framework_Cocoa-9.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:3b1e6287b3149e4c6679cdbccd8e9ef6557a4e492a892e80a77df143f40026d2"}, + {file = "pyobjc_framework_Cocoa-9.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:312977ce2e3989073c6b324c69ba24283de206fe7acd6dbbbaf3e29238a22537"}, + {file = "pyobjc_framework_Cocoa-9.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:aae7841cf40c26dd915f4dd828f91c6616e6b7998630b72e704750c09e00f334"}, + {file = "pyobjc_framework_Cocoa-9.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:739a421e14382a46cbeb9a883f192dceff368ad28ec34d895c48c0ad34cf2c1d"}, + {file = "pyobjc_framework_Cocoa-9.2-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:32d9ac1033fac1b821ddee8c68f972a7074ad8c50bec0bea9a719034c1c2fb94"}, + {file = "pyobjc_framework_Cocoa-9.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:b236bb965e41aeb2e215d4e98a5a230d4b63252c6d26e00924ea2e69540a59d6"}, ] [package.dependencies] -pyobjc-core = ">=9.0.1" +pyobjc-core = ">=9.2" [[package]] name = "pyobjc-framework-corebluetooth" -version = "9.0.1" +version = "9.2" description = "Wrappers for the framework CoreBluetooth on macOS" optional = false python-versions = ">=3.7" files = [ - {file = "pyobjc-framework-CoreBluetooth-9.0.1.tar.gz", hash = "sha256:bf008d7bfe13cda12a43ed82346acfad262e90824086b145394c154531b51841"}, - {file = "pyobjc_framework_CoreBluetooth-9.0.1-cp36-abi3-macosx_10_9_universal2.whl", hash = "sha256:62f15fc6e1d864a5e6afd26fe01947e5879b5322af23719d988981ca65b34a30"}, - {file = "pyobjc_framework_CoreBluetooth-9.0.1-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:15673b480b3695aba87ce9574154bd1997f03a784969642b0da5e990e9679f48"}, - {file = "pyobjc_framework_CoreBluetooth-9.0.1-cp36-abi3-macosx_11_0_universal2.whl", hash = "sha256:3560c55de7799cd7468b1282d6c2fca4823896ffbcb7d53be69b55c01a44592e"}, + {file = "pyobjc-framework-CoreBluetooth-9.2.tar.gz", hash = "sha256:cb2481b1dfe211ae9ce55f36537dc8155dbf0dc8ff26e0bc2e13f7afb0a291d1"}, + {file = "pyobjc_framework_CoreBluetooth-9.2-cp36-abi3-macosx_10_9_universal2.whl", hash = "sha256:53d888742119d0f0c725d0b0c2389f68e8f21f0cba6d6aec288c53260a0196b6"}, + {file = "pyobjc_framework_CoreBluetooth-9.2-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:179532882126526e38fe716a50fb0ee8f440e0b838d290252c515e622b5d0e49"}, + {file = "pyobjc_framework_CoreBluetooth-9.2-cp36-abi3-macosx_11_0_universal2.whl", hash = "sha256:256a5031ea9d8a7406541fa1b0dfac549b1de93deae8284605f9355b13fb58be"}, ] [package.dependencies] -pyobjc-core = ">=9.0.1" -pyobjc-framework-Cocoa = ">=9.0.1" +pyobjc-core = ">=9.2" +pyobjc-framework-Cocoa = ">=9.2" [[package]] name = "pyobjc-framework-libdispatch" -version = "9.0.1" +version = "9.2" description = "Wrappers for libdispatch on macOS" optional = false python-versions = ">=3.7" files = [ - {file = "pyobjc-framework-libdispatch-9.0.1.tar.gz", hash = "sha256:988c4c8608f2059c8b80ac520bc8d20a46ff85f65c50749110c45df610141fce"}, - {file = "pyobjc_framework_libdispatch-9.0.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:6cd32fea76165157a623ef8871f83cfa627ea2e878417704d6ac9c284c4211d5"}, - {file = "pyobjc_framework_libdispatch-9.0.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:2a0f8ba6b498a095edef07e7a55f11dda3a6b37706caaa0f954f297c9aa1122e"}, - {file = "pyobjc_framework_libdispatch-9.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:906f4e705b40ea878d0a7feddddac85965f9709f7a951c3d5459260d48efd56f"}, - {file = "pyobjc_framework_libdispatch-9.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0bd94e697e3739eaf093a9b6f5be9a2cc34faa96c66cc21d2c42a996a3b01242"}, - {file = "pyobjc_framework_libdispatch-9.0.1-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:7f9798c599acdd21251f57970bafabccc7fa723ae2a6d1fbe82f99ecfa3f7cf9"}, - {file = "pyobjc_framework_libdispatch-9.0.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:10a877b31960ee958873e5228f7b588c664014be8ad4d13a76a764482a18bf41"}, + {file = "pyobjc-framework-libdispatch-9.2.tar.gz", hash = "sha256:542e7f7c2b041939db5ed6f3119c1d67d73ec14a996278b92485f8513039c168"}, + {file = "pyobjc_framework_libdispatch-9.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:88d4091d4bcb5702783d6e86b4107db973425a17d1de491543f56bd348909b60"}, + {file = "pyobjc_framework_libdispatch-9.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:1a67b007113328538b57893cc7829a722270764cdbeae6d5e1460a1d911314df"}, + {file = "pyobjc_framework_libdispatch-9.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:6fccea1a57436cf1ac50d9ebc6e3e725bcf77f829ba6b118e62e6ed7866d359d"}, + {file = "pyobjc_framework_libdispatch-9.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:6eba747b7ad91b0463265a7aee59235bb051fb97687f35ca2233690369b5e4e4"}, + {file = "pyobjc_framework_libdispatch-9.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2e835495860d04f63c2d2f73ae3dd79da4222864c107096dc0f99e8382700026"}, + {file = "pyobjc_framework_libdispatch-9.2-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:1b107e5c3580b09553030961ea6b17abad4a5132101eab1af3ad2cb36d0f08bb"}, + {file = "pyobjc_framework_libdispatch-9.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:83cdb672acf722717b5ecf004768f215f02ac02d7f7f2a9703da6e921ab02222"}, ] [package.dependencies] -pyobjc-core = ">=9.0.1" +pyobjc-core = ">=9.2" [[package]] name = "pyparsing" @@ -927,4 +930,4 @@ testing = ["func-timeout", "jaraco.itertools", "pytest (>=6)", "pytest-black (>= [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "5f227d158a9bd163e028e1ae0af8074ffa712cd07fea2b8d628e98e37a65e3f8" +content-hash = "b8bf8407d977884494eaa9a62aa0f5dbffca6e4de17ea103d02aa8d60a01d95f" diff --git a/pyproject.toml b/pyproject.toml index bd3a1166..6d3d00b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ python = "^3.8" async-timeout = { version = ">= 3.0.0, < 5", python = "<3.11" } typing-extensions = { version = ">=4.7.0", python = "<3.12" } -pyobjc-core = { version = "^9.0.1", markers = "platform_system=='Darwin'" } -pyobjc-framework-CoreBluetooth = { version = "^9.0.1", markers = "platform_system=='Darwin'" } -pyobjc-framework-libdispatch = { version = "^9.0.1", markers = "platform_system=='Darwin'" } +pyobjc-core = { version = "^9.2", markers = "platform_system=='Darwin'" } +pyobjc-framework-CoreBluetooth = { version = "^9.2", markers = "platform_system=='Darwin'" } +pyobjc-framework-libdispatch = { version = "^9.2", markers = "platform_system=='Darwin'" } bleak-winrt = { version = "^1.2.0", markers = "platform_system=='Windows'" } dbus-fast = { version = "^1.83.0", markers = "platform_system == 'Linux'" } From 21094e67cf5d238b911352ba8c45a33d72f47d80 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Wed, 9 Aug 2023 14:55:27 -0500 Subject: [PATCH 04/10] implement PEP 692 type hints for BleakScanner kwargs Most of the class methods for BleakScanner allow passing **kwargs to the BleakScanner() constructor. PEP 692 now gives us a way to have proper type hints for this. --- CHANGELOG.rst | 1 + bleak/__init__.py | 48 ++++++++++++++++++++++++++++++++++++++++---- docs/api/scanner.rst | 2 ++ 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d7cd7ea4..0b9d1023 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -15,6 +15,7 @@ Added * Added ``bleak.uuids.normalize_uuid_16()`` function. * Added ``bleak.uuids.normalize_uuid_32()`` function. * Added ``advertisement_data()`` async iterator method to ``BleakScanner``. Merged #1361. +* Added type hints for kwargs on ``BleakScanner`` class methods. Changed ------- diff --git a/bleak/__init__.py b/bleak/__init__.py index 8a467203..28b5e3bc 100644 --- a/bleak/__init__.py +++ b/bleak/__init__.py @@ -26,6 +26,7 @@ Set, Tuple, Type, + TypedDict, Union, overload, ) @@ -39,8 +40,10 @@ if sys.version_info < (3, 11): from async_timeout import timeout as async_timeout + from typing_extensions import Unpack else: from asyncio import timeout as async_timeout + from typing import Unpack from .backends.characteristic import BleakGATTCharacteristic @@ -242,6 +245,38 @@ async def advertisement_data( finally: unregister_callback() + class ExtraArgs(TypedDict): + """ + Keyword args from :class:`~bleak.BleakScanner` that can be passed to + other convenience methods. + """ + + service_uuids: List[str] + """ + Optional list of service UUIDs to filter on. Only advertisements + containing this advertising data will be received. Required on + macOS >= 12.0, < 12.3 (unless you create an app with ``py2app``). + """ + scanning_mode: Literal["active", "passive"] + """ + Set to ``"passive"`` to avoid the ``"active"`` scanning mode. + Passive scanning is not supported on macOS! Will raise + :class:`BleakError` if set to ``"passive"`` on macOS. + """ + bluez: BlueZScannerArgs + """ + Dictionary of arguments specific to the BlueZ backend. + """ + cb: CBScannerArgs + """ + Dictionary of arguments specific to the CoreBluetooth backend. + """ + backend: Type[BaseBleakScanner] + """ + Used to override the automatically selected backend (i.e. for a + custom backend). + """ + @overload @classmethod async def discover( @@ -257,7 +292,9 @@ async def discover( ... @classmethod - async def discover(cls, timeout=5.0, *, return_adv=False, **kwargs): + async def discover( + cls, timeout=5.0, *, return_adv=False, **kwargs: Unpack[ExtraArgs] + ): """ Scan continuously for ``timeout`` seconds and return discovered devices. @@ -331,7 +368,7 @@ async def get_discovered_devices(self) -> List[BLEDevice]: @classmethod async def find_device_by_address( - cls, device_identifier: str, timeout: float = 10.0, **kwargs + cls, device_identifier: str, timeout: float = 10.0, **kwargs: Unpack[ExtraArgs] ) -> Optional[BLEDevice]: """Obtain a ``BLEDevice`` for a BLE server specified by Bluetooth address or (macOS) UUID address. @@ -353,7 +390,7 @@ async def find_device_by_address( @classmethod async def find_device_by_name( - cls, name: str, timeout: float = 10.0, **kwargs + cls, name: str, timeout: float = 10.0, **kwargs: Unpack[ExtraArgs] ) -> Optional[BLEDevice]: """Obtain a ``BLEDevice`` for a BLE server specified by the local name in the advertising data. @@ -375,7 +412,10 @@ async def find_device_by_name( @classmethod async def find_device_by_filter( - cls, filterfunc: AdvertisementDataFilter, timeout: float = 10.0, **kwargs + cls, + filterfunc: AdvertisementDataFilter, + timeout: float = 10.0, + **kwargs: Unpack[ExtraArgs], ) -> Optional[BLEDevice]: """Obtain a ``BLEDevice`` for a BLE server that matches a given filter function. diff --git a/docs/api/scanner.rst b/docs/api/scanner.rst index c5550752..1c232e71 100644 --- a/docs/api/scanner.rst +++ b/docs/api/scanner.rst @@ -19,6 +19,8 @@ multiple devices. .. automethod:: bleak.BleakScanner.find_device_by_name .. automethod:: bleak.BleakScanner.find_device_by_address .. automethod:: bleak.BleakScanner.find_device_by_filter +.. autoclass:: bleak.BleakScanner.ExtraArgs + :members: --------------------- From c8bf29cb2ea79aecc6fdbfadd571a12b610b9c33 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Fri, 1 Sep 2023 11:46:15 -0500 Subject: [PATCH 05/10] backends/winrt: start migration away from bleak_winrt The winrt packages are now being distributed as individual namespace packages, so we can take advantage of that instead of having to provide our own bleak_winrt package. The new packages haven't been tested much yet, so just enabling on Python 3.12 for now. --- bleak/backends/winrt/characteristic.py | 15 +- bleak/backends/winrt/client.py | 96 +++++++---- bleak/backends/winrt/descriptor.py | 10 +- bleak/backends/winrt/scanner.py | 24 ++- bleak/backends/winrt/service.py | 12 +- docs/conf.py | 1 + poetry.lock | 222 ++++++++++++++++++++++++- pyproject.toml | 11 +- 8 files changed, 339 insertions(+), 52 deletions(-) diff --git a/bleak/backends/winrt/characteristic.py b/bleak/backends/winrt/characteristic.py index e526f0fa..f72e9c67 100644 --- a/bleak/backends/winrt/characteristic.py +++ b/bleak/backends/winrt/characteristic.py @@ -1,11 +1,18 @@ # -*- coding: utf-8 -*- +import sys from typing import List, Union from uuid import UUID -from bleak_winrt.windows.devices.bluetooth.genericattributeprofile import ( - GattCharacteristic, - GattCharacteristicProperties, -) +if sys.version_info >= (3, 12): + from winrt.windows.devices.bluetooth.genericattributeprofile import ( + GattCharacteristic, + GattCharacteristicProperties, + ) +else: + from bleak_winrt.windows.devices.bluetooth.genericattributeprofile import ( + GattCharacteristic, + GattCharacteristicProperties, + ) from ..characteristic import BleakGATTCharacteristic from ..descriptor import BleakGATTDescriptor diff --git a/bleak/backends/winrt/client.py b/bleak/backends/winrt/client.py index 882fb696..6a84e21e 100644 --- a/bleak/backends/winrt/client.py +++ b/bleak/backends/winrt/client.py @@ -35,37 +35,70 @@ else: from asyncio import timeout as async_timeout -from bleak_winrt.windows.devices.bluetooth import ( - BluetoothAddressType, - BluetoothCacheMode, - BluetoothError, - BluetoothLEDevice, -) -from bleak_winrt.windows.devices.bluetooth.genericattributeprofile import ( - GattCharacteristic, - GattCharacteristicProperties, - GattClientCharacteristicConfigurationDescriptorValue, - GattCommunicationStatus, - GattDescriptor, - GattDeviceService, - GattSession, - GattSessionStatus, - GattSessionStatusChangedEventArgs, - GattValueChangedEventArgs, - GattWriteOption, -) -from bleak_winrt.windows.devices.enumeration import ( - DeviceInformation, - DevicePairingKinds, - DevicePairingResultStatus, - DeviceUnpairingResultStatus, -) -from bleak_winrt.windows.foundation import ( - AsyncStatus, - EventRegistrationToken, - IAsyncOperation, -) -from bleak_winrt.windows.storage.streams import Buffer as WinBuffer +if sys.version_info >= (3, 12): + from winrt.windows.devices.bluetooth import ( + BluetoothAddressType, + BluetoothCacheMode, + BluetoothError, + BluetoothLEDevice, + ) + from winrt.windows.devices.bluetooth.genericattributeprofile import ( + GattCharacteristic, + GattCharacteristicProperties, + GattClientCharacteristicConfigurationDescriptorValue, + GattCommunicationStatus, + GattDescriptor, + GattDeviceService, + GattSession, + GattSessionStatus, + GattSessionStatusChangedEventArgs, + GattValueChangedEventArgs, + GattWriteOption, + ) + from winrt.windows.devices.enumeration import ( + DeviceInformation, + DevicePairingKinds, + DevicePairingResultStatus, + DeviceUnpairingResultStatus, + ) + from winrt.windows.foundation import ( + AsyncStatus, + EventRegistrationToken, + IAsyncOperation, + ) + from winrt.windows.storage.streams import Buffer as WinBuffer +else: + from bleak_winrt.windows.devices.bluetooth import ( + BluetoothAddressType, + BluetoothCacheMode, + BluetoothError, + BluetoothLEDevice, + ) + from bleak_winrt.windows.devices.bluetooth.genericattributeprofile import ( + GattCharacteristic, + GattCharacteristicProperties, + GattClientCharacteristicConfigurationDescriptorValue, + GattCommunicationStatus, + GattDescriptor, + GattDeviceService, + GattSession, + GattSessionStatus, + GattSessionStatusChangedEventArgs, + GattValueChangedEventArgs, + GattWriteOption, + ) + from bleak_winrt.windows.devices.enumeration import ( + DeviceInformation, + DevicePairingKinds, + DevicePairingResultStatus, + DeviceUnpairingResultStatus, + ) + from bleak_winrt.windows.foundation import ( + AsyncStatus, + EventRegistrationToken, + IAsyncOperation, + ) + from bleak_winrt.windows.storage.streams import Buffer as WinBuffer from ... import BleakScanner from ...exc import PROTOCOL_ERROR_CODES, BleakDeviceNotFoundError, BleakError @@ -700,7 +733,6 @@ def dispose_on_cancel(future): try: for service in services: - result = await FutureLike(service.get_characteristics_async(*args)) if result.status == GattCommunicationStatus.ACCESS_DENIED: diff --git a/bleak/backends/winrt/descriptor.py b/bleak/backends/winrt/descriptor.py index 34a90fba..1203b754 100644 --- a/bleak/backends/winrt/descriptor.py +++ b/bleak/backends/winrt/descriptor.py @@ -1,6 +1,12 @@ # -*- coding: utf-8 -*- - -from bleak_winrt.windows.devices.bluetooth.genericattributeprofile import GattDescriptor +import sys + +if sys.version_info >= (3, 12): + from winrt.windows.devices.bluetooth.genericattributeprofile import GattDescriptor +else: + from bleak_winrt.windows.devices.bluetooth.genericattributeprofile import ( + GattDescriptor, + ) from ..descriptor import BleakGATTDescriptor diff --git a/bleak/backends/winrt/scanner.py b/bleak/backends/winrt/scanner.py index acb02f52..bfd46c71 100644 --- a/bleak/backends/winrt/scanner.py +++ b/bleak/backends/winrt/scanner.py @@ -1,15 +1,25 @@ import asyncio import logging +import sys from typing import Dict, List, Literal, NamedTuple, Optional from uuid import UUID -from bleak_winrt.windows.devices.bluetooth.advertisement import ( - BluetoothLEAdvertisementReceivedEventArgs, - BluetoothLEAdvertisementType, - BluetoothLEAdvertisementWatcher, - BluetoothLEAdvertisementWatcherStatus, - BluetoothLEScanningMode, -) +if sys.version_info >= (3, 12): + from winrt.windows.devices.bluetooth.advertisement import ( + BluetoothLEAdvertisementReceivedEventArgs, + BluetoothLEAdvertisementType, + BluetoothLEAdvertisementWatcher, + BluetoothLEAdvertisementWatcherStatus, + BluetoothLEScanningMode, + ) +else: + from bleak_winrt.windows.devices.bluetooth.advertisement import ( + BluetoothLEAdvertisementReceivedEventArgs, + BluetoothLEAdvertisementType, + BluetoothLEAdvertisementWatcher, + BluetoothLEAdvertisementWatcherStatus, + BluetoothLEScanningMode, + ) from ...assigned_numbers import AdvertisementDataType from ...uuids import normalize_uuid_str diff --git a/bleak/backends/winrt/service.py b/bleak/backends/winrt/service.py index 66fa6253..dde2d4ea 100644 --- a/bleak/backends/winrt/service.py +++ b/bleak/backends/winrt/service.py @@ -1,8 +1,14 @@ +import sys from typing import List -from bleak_winrt.windows.devices.bluetooth.genericattributeprofile import ( - GattDeviceService, -) +if sys.version_info >= (3, 12): + from winrt.windows.devices.bluetooth.genericattributeprofile import ( + GattDeviceService, + ) +else: + from bleak_winrt.windows.devices.bluetooth.genericattributeprofile import ( + GattDeviceService, + ) from ..service import BleakGATTService from ..winrt.characteristic import BleakGATTCharacteristicWinRT diff --git a/docs/conf.py b/docs/conf.py index f74ce744..f3e707eb 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -116,6 +116,7 @@ "android", "async_timeout", "bleak_winrt", + "winrt", "CoreBluetooth", "dbus_fast", "Foundation", diff --git a/poetry.lock b/poetry.lock index b431dfc4..ada0e16f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -912,6 +912,224 @@ brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)", "brotlipy (>=0.6.0)"] secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)", "urllib3-secure-extra"] socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] +[[package]] +name = "winrt-runtime" +version = "2.0.0b1" +description = "Python projection of Windows Runtime (WinRT) APIs" +optional = false +python-versions = "<3.13,>=3.9" +files = [ + {file = "winrt-runtime-2.0.0b1.tar.gz", hash = "sha256:28db2ebe7bfb347d110224e9f23fe8079cea45af0fcbd643d039524ced07d22c"}, + {file = "winrt_runtime-2.0.0b1-cp310-cp310-win32.whl", hash = "sha256:8f812b01e2c8dd3ca68aa51a7aa02e815cc2ac3c8520a883b4ec7a4fc63afb04"}, + {file = "winrt_runtime-2.0.0b1-cp310-cp310-win_amd64.whl", hash = "sha256:f36f6102f9b7a08d917a6809117c085639b66be2c579f4089d3fd47b83e8f87b"}, + {file = "winrt_runtime-2.0.0b1-cp310-cp310-win_arm64.whl", hash = "sha256:4a99f267da96edc977623355b816b46c1344c66dc34732857084417d8cf9a96b"}, + {file = "winrt_runtime-2.0.0b1-cp311-cp311-win32.whl", hash = "sha256:ba998e3fc452338c5e2d7bf5174a6206580245066d60079ee4130082d0eb61c2"}, + {file = "winrt_runtime-2.0.0b1-cp311-cp311-win_amd64.whl", hash = "sha256:e7838f0fdf5653ce245888590214177a1f54884cece2c8dfbfe3d01b2780171e"}, + {file = "winrt_runtime-2.0.0b1-cp311-cp311-win_arm64.whl", hash = "sha256:2afa45b7385e99a63d55ccda29096e6a84fcd4c654479005c147b0e65e274abf"}, + {file = "winrt_runtime-2.0.0b1-cp312-cp312-win32.whl", hash = "sha256:edda124ff965cec3a6bfdb26fbe88e004f96975dd84115176e30c1efbcb16f4c"}, + {file = "winrt_runtime-2.0.0b1-cp312-cp312-win_amd64.whl", hash = "sha256:d8935951efeec6b3d546dce8f48bb203aface57a1ba991c066f0e12e84c8f91e"}, + {file = "winrt_runtime-2.0.0b1-cp312-cp312-win_arm64.whl", hash = "sha256:509fb9a03af5e1125433f58522725716ceef040050d33625460b5a5eb98a46ac"}, + {file = "winrt_runtime-2.0.0b1-cp39-cp39-win32.whl", hash = "sha256:41138fe4642345d7143e817ce0905d82e60b3832558143e0a17bfea8654c6512"}, + {file = "winrt_runtime-2.0.0b1-cp39-cp39-win_amd64.whl", hash = "sha256:081a429fe85c33cb6610c4a799184b7650b30f15ab1d89866f2bda246d3a5c0a"}, + {file = "winrt_runtime-2.0.0b1-cp39-cp39-win_arm64.whl", hash = "sha256:e6984604c6ae1f3258973ba2503d1ea5aa15e536ca41d6a131ad305ebbb6519d"}, +] + +[[package]] +name = "winrt-windows-devices-bluetooth" +version = "2.0.0b1" +description = "Python projection of Windows Runtime (WinRT) APIs" +optional = false +python-versions = "<3.13,>=3.9" +files = [ + {file = "winrt-Windows.Devices.Bluetooth-2.0.0b1.tar.gz", hash = "sha256:786bd43786b873a083b89debece538974f720584662a2573d6a8a8501a532860"}, + {file = "winrt_Windows.Devices.Bluetooth-2.0.0b1-cp310-cp310-win32.whl", hash = "sha256:79631bf3f96954da260859df9228a028835ffade0d885ba3942c5a86a853d150"}, + {file = "winrt_Windows.Devices.Bluetooth-2.0.0b1-cp310-cp310-win_amd64.whl", hash = "sha256:cd85337a95065d0d2045c06db1a5edd4a447aad47cf7027818f6fb69f831c56c"}, + {file = "winrt_Windows.Devices.Bluetooth-2.0.0b1-cp310-cp310-win_arm64.whl", hash = "sha256:6a963869ed003d260e90e9bedc334129303f263f068ea1c0d994df53317db2bc"}, + {file = "winrt_Windows.Devices.Bluetooth-2.0.0b1-cp311-cp311-win32.whl", hash = "sha256:7c5951943a3911d94a8da190f4355dc70128d7d7f696209316372c834b34d462"}, + {file = "winrt_Windows.Devices.Bluetooth-2.0.0b1-cp311-cp311-win_amd64.whl", hash = "sha256:b0bb154ae92235649ed234982f609c490a467d5049c27d63397be9abbb00730e"}, + {file = "winrt_Windows.Devices.Bluetooth-2.0.0b1-cp311-cp311-win_arm64.whl", hash = "sha256:6688dfb0fc3b7dc517bf8cf40ae00544a50b4dec91470d37be38fc33c4523632"}, + {file = "winrt_Windows.Devices.Bluetooth-2.0.0b1-cp312-cp312-win32.whl", hash = "sha256:613c6ff4125df46189b3bef6d3110d94ec725d357ab734f00eedb11c4116c367"}, + {file = "winrt_Windows.Devices.Bluetooth-2.0.0b1-cp312-cp312-win_amd64.whl", hash = "sha256:59c403b64e9f4e417599c6f6aea6ee6fac960597c21eac6b3fd8a84f64aa387c"}, + {file = "winrt_Windows.Devices.Bluetooth-2.0.0b1-cp312-cp312-win_arm64.whl", hash = "sha256:b7f6e1b9bb6e33be80045adebd252cf25cd648759fad6e86c61a393ddd709f7f"}, + {file = "winrt_Windows.Devices.Bluetooth-2.0.0b1-cp39-cp39-win32.whl", hash = "sha256:eae7a89106eab047e96843e28c3c6ce0886dd7dee60180a1010498925e9503f9"}, + {file = "winrt_Windows.Devices.Bluetooth-2.0.0b1-cp39-cp39-win_amd64.whl", hash = "sha256:8dfd1915c894ac19dd0b24aba38ef676c92c3473c0d9826762ba9616ad7df68b"}, + {file = "winrt_Windows.Devices.Bluetooth-2.0.0b1-cp39-cp39-win_arm64.whl", hash = "sha256:49058587e6d82ba33da0767b97a378ddfea8e3a5991bdeff680faa287bfae57e"}, +] + +[package.dependencies] +winrt-runtime = "2.0.0-beta.1" + +[package.extras] +all = ["winrt-Windows.Devices.Bluetooth.GenericAttributeProfile[all] (==2.0.0-beta.1)", "winrt-Windows.Devices.Bluetooth.Rfcomm[all] (==2.0.0-beta.1)", "winrt-Windows.Devices.Enumeration[all] (==2.0.0-beta.1)", "winrt-Windows.Devices.Radios[all] (==2.0.0-beta.1)", "winrt-Windows.Foundation.Collections[all] (==2.0.0-beta.1)", "winrt-Windows.Foundation[all] (==2.0.0-beta.1)", "winrt-Windows.Networking[all] (==2.0.0-beta.1)", "winrt-Windows.Storage.Streams[all] (==2.0.0-beta.1)"] + +[[package]] +name = "winrt-windows-devices-bluetooth-advertisement" +version = "2.0.0b1" +description = "Python projection of Windows Runtime (WinRT) APIs" +optional = false +python-versions = "<3.13,>=3.9" +files = [ + {file = "winrt-Windows.Devices.Bluetooth.Advertisement-2.0.0b1.tar.gz", hash = "sha256:d9050faa4377d410d4f0e9cabb5ec555a267531c9747370555ac9ec93ec9f399"}, + {file = "winrt_Windows.Devices.Bluetooth.Advertisement-2.0.0b1-cp310-cp310-win32.whl", hash = "sha256:ac9b703d16adc87c3541585525b8fcf6d84391e2fa010c2f001e714c405cc3b7"}, + {file = "winrt_Windows.Devices.Bluetooth.Advertisement-2.0.0b1-cp310-cp310-win_amd64.whl", hash = "sha256:593cade7853a8b0770e8ef30462b5d5f477b82e17e0aa590094b1c26efd3e05a"}, + {file = "winrt_Windows.Devices.Bluetooth.Advertisement-2.0.0b1-cp310-cp310-win_arm64.whl", hash = "sha256:574698c08895e2cfee7379bdf34a5f319fe440d7dfcc7bc9858f457c08e9712c"}, + {file = "winrt_Windows.Devices.Bluetooth.Advertisement-2.0.0b1-cp311-cp311-win32.whl", hash = "sha256:652a096f8210036bbb539d7f971eaf1f472a3aeb60b7e31278e3d0d30a355292"}, + {file = "winrt_Windows.Devices.Bluetooth.Advertisement-2.0.0b1-cp311-cp311-win_amd64.whl", hash = "sha256:e5cfb866c44dad644fb44b441f4fdbddafc9564075f1f68f756e20f438105c67"}, + {file = "winrt_Windows.Devices.Bluetooth.Advertisement-2.0.0b1-cp311-cp311-win_arm64.whl", hash = "sha256:6c2503eaaf5cd988b5510b86347dba45ad6ee52656f9656a1a97abae6d35386e"}, + {file = "winrt_Windows.Devices.Bluetooth.Advertisement-2.0.0b1-cp312-cp312-win32.whl", hash = "sha256:780c766725a55f4211f921c773c92c2331803e70f65d6ad6676a60f903d39a54"}, + {file = "winrt_Windows.Devices.Bluetooth.Advertisement-2.0.0b1-cp312-cp312-win_amd64.whl", hash = "sha256:39c8633d01039eb2c2f6f20cfc43c045a333b9f3a45229e2ce443f71bb2a562c"}, + {file = "winrt_Windows.Devices.Bluetooth.Advertisement-2.0.0b1-cp312-cp312-win_arm64.whl", hash = "sha256:eaa0d44b4158b16937eac8102249e792f0299dbb0aefc56cc9adc9552e8f9afe"}, + {file = "winrt_Windows.Devices.Bluetooth.Advertisement-2.0.0b1-cp39-cp39-win32.whl", hash = "sha256:d171487e23f7671ad2923544bfa6545d0a29a1a9ae1f5c1d5e5e5f473a5d62b2"}, + {file = "winrt_Windows.Devices.Bluetooth.Advertisement-2.0.0b1-cp39-cp39-win_amd64.whl", hash = "sha256:442eecac87653a03617e65bdb2ef79ddc0582dfdacc2be8af841fba541577f8b"}, + {file = "winrt_Windows.Devices.Bluetooth.Advertisement-2.0.0b1-cp39-cp39-win_arm64.whl", hash = "sha256:b30ab9b8c1ecf818be08bac86bee425ef40f75060c4011d4e6c2e624a7b9916e"}, +] + +[package.dependencies] +winrt-runtime = "2.0.0-beta.1" + +[package.extras] +all = ["winrt-Windows.Devices.Bluetooth[all] (==2.0.0-beta.1)", "winrt-Windows.Foundation.Collections[all] (==2.0.0-beta.1)", "winrt-Windows.Foundation[all] (==2.0.0-beta.1)", "winrt-Windows.Storage.Streams[all] (==2.0.0-beta.1)"] + +[[package]] +name = "winrt-windows-devices-bluetooth-genericattributeprofile" +version = "2.0.0b1" +description = "Python projection of Windows Runtime (WinRT) APIs" +optional = false +python-versions = "<3.13,>=3.9" +files = [ + {file = "winrt-Windows.Devices.Bluetooth.GenericAttributeProfile-2.0.0b1.tar.gz", hash = "sha256:93b745d51ecfb3e9d3a21623165cc065735c9e0146cb7a26744182c164e63e14"}, + {file = "winrt_Windows.Devices.Bluetooth.GenericAttributeProfile-2.0.0b1-cp310-cp310-win32.whl", hash = "sha256:db740aaedd80cca5b1a390663b26c7733eb08f4c57ade6a04b055d548e9d042b"}, + {file = "winrt_Windows.Devices.Bluetooth.GenericAttributeProfile-2.0.0b1-cp310-cp310-win_amd64.whl", hash = "sha256:7c81aa6c066cdab58bcc539731f208960e094a6d48b59118898e1e804dbbdf7f"}, + {file = "winrt_Windows.Devices.Bluetooth.GenericAttributeProfile-2.0.0b1-cp310-cp310-win_arm64.whl", hash = "sha256:92277a6bbcbe2225ad1be92968af597dc77bc37a63cd729690d2d9fb5094ae25"}, + {file = "winrt_Windows.Devices.Bluetooth.GenericAttributeProfile-2.0.0b1-cp311-cp311-win32.whl", hash = "sha256:6b48209669c1e214165530793cf9916ae44a0ae2618a9be7a489e8c94f7e745f"}, + {file = "winrt_Windows.Devices.Bluetooth.GenericAttributeProfile-2.0.0b1-cp311-cp311-win_amd64.whl", hash = "sha256:2f17216e6ce748eaef02fb0658213515d3ff31e2dbb18f070a614876f818c90d"}, + {file = "winrt_Windows.Devices.Bluetooth.GenericAttributeProfile-2.0.0b1-cp311-cp311-win_arm64.whl", hash = "sha256:db798a0f0762e390da5a9f02f822daff00692bd951a492224bf46782713b2938"}, + {file = "winrt_Windows.Devices.Bluetooth.GenericAttributeProfile-2.0.0b1-cp312-cp312-win32.whl", hash = "sha256:b8d9dba04b9cfa53971c35117fc3c68c94bfa5e2ed18ce680f731743598bf246"}, + {file = "winrt_Windows.Devices.Bluetooth.GenericAttributeProfile-2.0.0b1-cp312-cp312-win_amd64.whl", hash = "sha256:e5260b3f33dee8a896604297e05efc04d04298329c205a74ded8e2d6333e84b7"}, + {file = "winrt_Windows.Devices.Bluetooth.GenericAttributeProfile-2.0.0b1-cp312-cp312-win_arm64.whl", hash = "sha256:822ef539389ecb546004345c4dce8b9b7788e2e99a1d6f0947a4b123dceb7fed"}, + {file = "winrt_Windows.Devices.Bluetooth.GenericAttributeProfile-2.0.0b1-cp39-cp39-win32.whl", hash = "sha256:11e6863e7a94d2b6dd76ddcd19c01e311895810a4ce6ad08c7b5534294753243"}, + {file = "winrt_Windows.Devices.Bluetooth.GenericAttributeProfile-2.0.0b1-cp39-cp39-win_amd64.whl", hash = "sha256:20de8d04c301c406362c93e78d41912aea0af23c4b430704aba329420d7c2cdf"}, + {file = "winrt_Windows.Devices.Bluetooth.GenericAttributeProfile-2.0.0b1-cp39-cp39-win_arm64.whl", hash = "sha256:918059796f2f123216163b928ecde8ecec17994fb7a94042af07fda82c132a6d"}, +] + +[package.dependencies] +winrt-runtime = "2.0.0-beta.1" + +[package.extras] +all = ["winrt-Windows.Devices.Bluetooth[all] (==2.0.0-beta.1)", "winrt-Windows.Devices.Enumeration[all] (==2.0.0-beta.1)", "winrt-Windows.Foundation.Collections[all] (==2.0.0-beta.1)", "winrt-Windows.Foundation[all] (==2.0.0-beta.1)", "winrt-Windows.Storage.Streams[all] (==2.0.0-beta.1)"] + +[[package]] +name = "winrt-windows-devices-enumeration" +version = "2.0.0b1" +description = "Python projection of Windows Runtime (WinRT) APIs" +optional = false +python-versions = "<3.13,>=3.9" +files = [ + {file = "winrt-Windows.Devices.Enumeration-2.0.0b1.tar.gz", hash = "sha256:8f214040e4edbe57c4943488887db89f4a00d028c34169aafd2205e228026100"}, + {file = "winrt_Windows.Devices.Enumeration-2.0.0b1-cp310-cp310-win32.whl", hash = "sha256:dcb9e7d230aefec8531a46d393ecb1063b9d4b97c9f3ff2fc537ce22bdfa2444"}, + {file = "winrt_Windows.Devices.Enumeration-2.0.0b1-cp310-cp310-win_amd64.whl", hash = "sha256:22a3e1fef40786cc8d51320b6f11ff25de6c674475f3ba608a46915e1dadf0f5"}, + {file = "winrt_Windows.Devices.Enumeration-2.0.0b1-cp310-cp310-win_arm64.whl", hash = "sha256:2edcfeb70a71d40622873cad96982a28e92a7ee71f33968212dd3598b2d8d469"}, + {file = "winrt_Windows.Devices.Enumeration-2.0.0b1-cp311-cp311-win32.whl", hash = "sha256:ce4eb88add7f5946d2666761a97a3bb04cac2a061d264f03229c1e15dbd7ce91"}, + {file = "winrt_Windows.Devices.Enumeration-2.0.0b1-cp311-cp311-win_amd64.whl", hash = "sha256:a9001f17991572abdddab7ab074e08046e74e05eeeaf3b2b01b8b47d2879b64c"}, + {file = "winrt_Windows.Devices.Enumeration-2.0.0b1-cp311-cp311-win_arm64.whl", hash = "sha256:0440b91ce144111e207f084cec6b1277162ef2df452d321951e989ce87dc9ced"}, + {file = "winrt_Windows.Devices.Enumeration-2.0.0b1-cp312-cp312-win32.whl", hash = "sha256:e4fae13126f13a8d9420b74fb5a5ff6a6b2f91f7718c4be2d4a8dc1337c58f59"}, + {file = "winrt_Windows.Devices.Enumeration-2.0.0b1-cp312-cp312-win_amd64.whl", hash = "sha256:e352eebc23dc94fb79e67a056c057fb0e16c20c8cb881dc826094c20ed4791e3"}, + {file = "winrt_Windows.Devices.Enumeration-2.0.0b1-cp312-cp312-win_arm64.whl", hash = "sha256:b43f5c1f053a170e6e4b44ba69838ac223f9051adca1a56506d4c46e98d1485f"}, + {file = "winrt_Windows.Devices.Enumeration-2.0.0b1-cp39-cp39-win32.whl", hash = "sha256:ed245fad8de6a134d5c3a630204e7f8238aa944a40388005bce0ce3718c410fa"}, + {file = "winrt_Windows.Devices.Enumeration-2.0.0b1-cp39-cp39-win_amd64.whl", hash = "sha256:22a9eefdbfe520778512266d0b48ff239eaa8d272fce6f5cb1ff352bed0619f4"}, + {file = "winrt_Windows.Devices.Enumeration-2.0.0b1-cp39-cp39-win_arm64.whl", hash = "sha256:397d43f8fd2621a7719b9eab6a4a8e72a1d6fa2d9c36525a30812f8e7bad3bdf"}, +] + +[package.dependencies] +winrt-runtime = "2.0.0-beta.1" + +[package.extras] +all = ["winrt-Windows.ApplicationModel.Background[all] (==2.0.0-beta.1)", "winrt-Windows.Foundation.Collections[all] (==2.0.0-beta.1)", "winrt-Windows.Foundation[all] (==2.0.0-beta.1)", "winrt-Windows.Security.Credentials[all] (==2.0.0-beta.1)", "winrt-Windows.Storage.Streams[all] (==2.0.0-beta.1)", "winrt-Windows.UI.Popups[all] (==2.0.0-beta.1)", "winrt-Windows.UI[all] (==2.0.0-beta.1)"] + +[[package]] +name = "winrt-windows-foundation" +version = "2.0.0b1" +description = "Python projection of Windows Runtime (WinRT) APIs" +optional = false +python-versions = "<3.13,>=3.9" +files = [ + {file = "winrt-Windows.Foundation-2.0.0b1.tar.gz", hash = "sha256:976b6da942747a7ca5a179a35729d8dc163f833e03b085cf940332a5e9070d54"}, + {file = "winrt_Windows.Foundation-2.0.0b1-cp310-cp310-win32.whl", hash = "sha256:5337ac1ec260132fbff868603e73a3738d4001911226e72669b3d69c8a256d5e"}, + {file = "winrt_Windows.Foundation-2.0.0b1-cp310-cp310-win_amd64.whl", hash = "sha256:af969e5bb9e2e41e4e86a361802528eafb5eb8fe87ec1dba6048c0702d63caa8"}, + {file = "winrt_Windows.Foundation-2.0.0b1-cp310-cp310-win_arm64.whl", hash = "sha256:bbbfa6b3c444a1074a630fd4a1b71171be7a5c9bb07c827ad9259fadaed56cf2"}, + {file = "winrt_Windows.Foundation-2.0.0b1-cp311-cp311-win32.whl", hash = "sha256:b91bd92b1854c073acd81aa87cf8df571d2151b1dd050b6181aa36f7acc43df4"}, + {file = "winrt_Windows.Foundation-2.0.0b1-cp311-cp311-win_amd64.whl", hash = "sha256:2f5359f25703347e827dbac982150354069030f1deecd616f7ce37ad90cbcb00"}, + {file = "winrt_Windows.Foundation-2.0.0b1-cp311-cp311-win_arm64.whl", hash = "sha256:0f1f1978173ddf0ee6262c2edb458f62d628b9fa0df10cd1e8c78c833af3197e"}, + {file = "winrt_Windows.Foundation-2.0.0b1-cp312-cp312-win32.whl", hash = "sha256:c1d23b737f733104b91c89c507b58d0b3ef5f3234a1b608ef6dfb6dbbb8777ea"}, + {file = "winrt_Windows.Foundation-2.0.0b1-cp312-cp312-win_amd64.whl", hash = "sha256:95de6c29e9083fe63f127b965b54dfa52a6424a93a94ce87cfad4c1900a6e887"}, + {file = "winrt_Windows.Foundation-2.0.0b1-cp312-cp312-win_arm64.whl", hash = "sha256:4707063a5a6980e3f71aebeea5ac93101c753ec13a0b47be9ea4dbc0d5ff361e"}, + {file = "winrt_Windows.Foundation-2.0.0b1-cp39-cp39-win32.whl", hash = "sha256:d0259f1f4a1b8e20d0cbd935a889c0f7234f720645590260f9cf3850fdc1e1fa"}, + {file = "winrt_Windows.Foundation-2.0.0b1-cp39-cp39-win_amd64.whl", hash = "sha256:15c7b324d0f59839fb4492d84bb1c870881c5c67cb94ac24c664a7c4dce1c475"}, + {file = "winrt_Windows.Foundation-2.0.0b1-cp39-cp39-win_arm64.whl", hash = "sha256:16ad741f4d38e99f8409ba5760299d0052003255f970f49f4b8ba2e0b609c8b7"}, +] + +[package.dependencies] +winrt-runtime = "2.0.0-beta.1" + +[package.extras] +all = ["winrt-Windows.Foundation.Collections[all] (==2.0.0-beta.1)"] + +[[package]] +name = "winrt-windows-foundation-collections" +version = "2.0.0b1" +description = "Python projection of Windows Runtime (WinRT) APIs" +optional = false +python-versions = "<3.13,>=3.9" +files = [ + {file = "winrt-Windows.Foundation.Collections-2.0.0b1.tar.gz", hash = "sha256:185d30f8103934124544a40aac005fa5918a9a7cb3179f45e9863bb86e22ad43"}, + {file = "winrt_Windows.Foundation.Collections-2.0.0b1-cp310-cp310-win32.whl", hash = "sha256:042142e916a170778b7154498aae61254a1a94c552954266b73479479d24f01d"}, + {file = "winrt_Windows.Foundation.Collections-2.0.0b1-cp310-cp310-win_amd64.whl", hash = "sha256:9f68e66055121fc1e04c4fda627834aceee6fbe922e77d6ccaecf9582e714c57"}, + {file = "winrt_Windows.Foundation.Collections-2.0.0b1-cp310-cp310-win_arm64.whl", hash = "sha256:a4609411263cc7f5e93a9a5677b21e2ef130e26f9030bfa960b3e82595324298"}, + {file = "winrt_Windows.Foundation.Collections-2.0.0b1-cp311-cp311-win32.whl", hash = "sha256:5296858aa44c53936460a119794b80eedd6bd094016c1bf96822f92cb95ea419"}, + {file = "winrt_Windows.Foundation.Collections-2.0.0b1-cp311-cp311-win_amd64.whl", hash = "sha256:3db1e1c80c97474e7c88b6052bd8982ca61723fd58ace11dc91a5522662e0b2a"}, + {file = "winrt_Windows.Foundation.Collections-2.0.0b1-cp311-cp311-win_arm64.whl", hash = "sha256:c3a594e660c59f9fab04ae2f40bda7c809e8ec4748bada4424dfb02b43d4bfe1"}, + {file = "winrt_Windows.Foundation.Collections-2.0.0b1-cp312-cp312-win32.whl", hash = "sha256:0f355ee943ec5b835e694d97e9e93545a42d6fb984a61f442467789550d62c3f"}, + {file = "winrt_Windows.Foundation.Collections-2.0.0b1-cp312-cp312-win_amd64.whl", hash = "sha256:c4a0cd2eb9f47c7ca3b66d12341cc822250bf26854a93fd58ab77f7a48dfab3a"}, + {file = "winrt_Windows.Foundation.Collections-2.0.0b1-cp312-cp312-win_arm64.whl", hash = "sha256:744dbef50e8b8f34904083cae9ad43ac6e28facb9e166c4f123ce8e758141067"}, + {file = "winrt_Windows.Foundation.Collections-2.0.0b1-cp39-cp39-win32.whl", hash = "sha256:b7c767184aec3a3d7cba2cd84fadcd68106854efabef1a61092052294d6d6f4f"}, + {file = "winrt_Windows.Foundation.Collections-2.0.0b1-cp39-cp39-win_amd64.whl", hash = "sha256:7c1ffe99c12f14fc4ab7027757780e6d850fa2fb23ec404a54311fbd9f1970d3"}, + {file = "winrt_Windows.Foundation.Collections-2.0.0b1-cp39-cp39-win_arm64.whl", hash = "sha256:870fa040ed36066e4c240c35973d8b2e0d7c38cc6050a42d993715ec9e3b748c"}, +] + +[package.dependencies] +winrt-runtime = "2.0.0-beta.1" + +[package.extras] +all = ["winrt-Windows.Foundation[all] (==2.0.0-beta.1)"] + +[[package]] +name = "winrt-windows-storage-streams" +version = "2.0.0b1" +description = "Python projection of Windows Runtime (WinRT) APIs" +optional = false +python-versions = "<3.13,>=3.9" +files = [ + {file = "winrt-Windows.Storage.Streams-2.0.0b1.tar.gz", hash = "sha256:029d67cdc9b092d56c682740fe3c42f267dc5d3346b5c0b12ebc03f38e7d2f1f"}, + {file = "winrt_Windows.Storage.Streams-2.0.0b1-cp310-cp310-win32.whl", hash = "sha256:49c90d4bfd539f6676226dfcb4b3574ddd6be528ffc44aa214c55af88c2de89e"}, + {file = "winrt_Windows.Storage.Streams-2.0.0b1-cp310-cp310-win_amd64.whl", hash = "sha256:22cc82779cada84aa2633841e25b33f3357737d912a1d9ecc1ee5a8b799b5171"}, + {file = "winrt_Windows.Storage.Streams-2.0.0b1-cp310-cp310-win_arm64.whl", hash = "sha256:b1750a111be32466f4f0781cbb5df195ac940690571dff4564492b921b162563"}, + {file = "winrt_Windows.Storage.Streams-2.0.0b1-cp311-cp311-win32.whl", hash = "sha256:e79b1183ab26d9b95cf3e6dbe3f488a40605174a5a112694dbb7dbfb50899daf"}, + {file = "winrt_Windows.Storage.Streams-2.0.0b1-cp311-cp311-win_amd64.whl", hash = "sha256:3e90a1207eb3076f051a7785132f7b056b37343a68e9481a50c6defb3f660099"}, + {file = "winrt_Windows.Storage.Streams-2.0.0b1-cp311-cp311-win_arm64.whl", hash = "sha256:4da06522b4fa9cfcc046b604cc4aa1c6a887cc4bb5b8a637ed9bff8028a860bb"}, + {file = "winrt_Windows.Storage.Streams-2.0.0b1-cp312-cp312-win32.whl", hash = "sha256:6f74f8ab8ac0d8de61c709043315361d8ac63f8144f3098d428472baadf8246a"}, + {file = "winrt_Windows.Storage.Streams-2.0.0b1-cp312-cp312-win_amd64.whl", hash = "sha256:5cf7c8d67836c60392d167bfe4f98ac7abcb691bfba2d19e322d0f9181f58347"}, + {file = "winrt_Windows.Storage.Streams-2.0.0b1-cp312-cp312-win_arm64.whl", hash = "sha256:f7f679f2c0f71791eca835856f57942ee5245094c1840a6c34bc7c2176b1bcd6"}, + {file = "winrt_Windows.Storage.Streams-2.0.0b1-cp39-cp39-win32.whl", hash = "sha256:5beb53429fa9a11ede56b4a7cefe28c774b352dd355f7951f2a4dd7e9ec9b39a"}, + {file = "winrt_Windows.Storage.Streams-2.0.0b1-cp39-cp39-win_amd64.whl", hash = "sha256:f84233c4b500279d8f5840cb8c47776bc040fcecba05c6c9ab9767053698fc8b"}, + {file = "winrt_Windows.Storage.Streams-2.0.0b1-cp39-cp39-win_arm64.whl", hash = "sha256:cfb163ddbb435906f75ef92a768573b0190e194e1438cea5a4c1d4d32a6b9386"}, +] + +[package.dependencies] +winrt-runtime = "2.0.0-beta.1" + +[package.extras] +all = ["winrt-Windows.Foundation.Collections[all] (==2.0.0-beta.1)", "winrt-Windows.Foundation[all] (==2.0.0-beta.1)", "winrt-Windows.Storage[all] (==2.0.0-beta.1)", "winrt-Windows.System[all] (==2.0.0-beta.1)"] + [[package]] name = "zipp" version = "3.8.1" @@ -929,5 +1147,5 @@ testing = ["func-timeout", "jaraco.itertools", "pytest (>=6)", "pytest-black (>= [metadata] lock-version = "2.0" -python-versions = "^3.8" -content-hash = "b8bf8407d977884494eaa9a62aa0f5dbffca6e4de17ea103d02aa8d60a01d95f" +python-versions = ">=3.8,<3.13" +content-hash = "5a9c2757ded08c2dd057e86dbb904e4c712f71d99a1613b18967b82bc793935d" diff --git a/pyproject.toml b/pyproject.toml index 6d3d00b6..b9266f92 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,13 +22,20 @@ classifiers = [ "Issues" = "https://github.com/hbldh/bleak/issues" [tool.poetry.dependencies] -python = "^3.8" +python = ">=3.8,<3.13" async-timeout = { version = ">= 3.0.0, < 5", python = "<3.11" } typing-extensions = { version = ">=4.7.0", python = "<3.12" } pyobjc-core = { version = "^9.2", markers = "platform_system=='Darwin'" } pyobjc-framework-CoreBluetooth = { version = "^9.2", markers = "platform_system=='Darwin'" } pyobjc-framework-libdispatch = { version = "^9.2", markers = "platform_system=='Darwin'" } -bleak-winrt = { version = "^1.2.0", markers = "platform_system=='Windows'" } +bleak-winrt = { version = "^1.2.0", markers = "platform_system=='Windows'", python = "<3.12" } +"winrt-Windows.Devices.Bluetooth" = { version = "2.0.0b1", allow-prereleases = true, markers = "platform_system=='Windows'", python = ">=3.12" } +"winrt-Windows.Devices.Bluetooth.Advertisement" = { version = "2.0.0b1", allow-prereleases = true, markers = "platform_system=='Windows'", python = ">=3.12" } +"winrt-Windows.Devices.Bluetooth.GenericAttributeProfile" = { version = "2.0.0b1", allow-prereleases = true, markers = "platform_system=='Windows'", python = ">=3.12" } +"winrt-Windows.Devices.Enumeration" = { version = "2.0.0b1", allow-prereleases = true, markers = "platform_system=='Windows'", python = ">=3.12" } +"winrt-Windows.Foundation" = { version = "2.0.0b1", allow-prereleases = true, markers = "platform_system=='Windows'", python = ">=3.12" } +"winrt-Windows.Foundation.Collections" = { version = "2.0.0b1", allow-prereleases = true, markers = "platform_system=='Windows'", python = ">=3.12" } +"winrt-Windows.Storage.Streams" = { version = "2.0.0b1", allow-prereleases = true, markers = "platform_system=='Windows'", python = ">=3.12" } dbus-fast = { version = "^1.83.0", markers = "platform_system == 'Linux'" } [tool.poetry.group.docs.dependencies] From 783c63f758a761346f55adcac1cec8402dd15ca7 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Sat, 2 Sep 2023 13:21:49 -0500 Subject: [PATCH 06/10] docs: mock typing_extensions --- docs/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/conf.py b/docs/conf.py index f3e707eb..9da6b546 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -124,6 +124,7 @@ "libdispatch", "objc", "ctypes", + "typing_extensions", ] # -- Options for HTML output ------------------------------------------- From a377ce63766f1910725ada26caad1efe1f7ca281 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 2 Sep 2023 19:12:58 +0000 Subject: [PATCH 07/10] build(deps-dev): bump certifi from 2022.12.7 to 2023.7.22 Bumps [certifi](https://github.com/certifi/python-certifi) from 2022.12.7 to 2023.7.22. - [Commits](https://github.com/certifi/python-certifi/compare/2022.12.07...2023.07.22) --- updated-dependencies: - dependency-name: certifi dependency-type: indirect ... Signed-off-by: dependabot[bot] --- poetry.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/poetry.lock b/poetry.lock index ada0e16f..4ef38a5b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. [[package]] name = "alabaster" @@ -121,13 +121,13 @@ files = [ [[package]] name = "certifi" -version = "2022.12.7" +version = "2023.7.22" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2022.12.7-py3-none-any.whl", hash = "sha256:4ad3232f5e926d6718ec31cfc1fcadfde020920e278684144551c91769c7bc18"}, - {file = "certifi-2022.12.7.tar.gz", hash = "sha256:35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3"}, + {file = "certifi-2023.7.22-py3-none-any.whl", hash = "sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9"}, + {file = "certifi-2023.7.22.tar.gz", hash = "sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082"}, ] [[package]] From 20e5365dd7d95dbb8ac2e246068d4ed9b3abd6e4 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 8 Sep 2023 17:55:32 -0500 Subject: [PATCH 08/10] Loosen dbus-fast pin to allow for dbus-fast 2.0 (#1416) --- CHANGELOG.rst | 4 +++ poetry.lock | 69 ++++++++++++++++++++++++++------------------------ pyproject.toml | 2 +- 3 files changed, 41 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 723d8ee5..f8fdb946 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,6 +10,10 @@ and this project adheres to `Semantic Versioning =3.0.0", markers = "python_version < \"3.11\""} - [[package]] name = "docutils" version = "0.17.1" @@ -1148,4 +1151,4 @@ testing = ["func-timeout", "jaraco.itertools", "pytest (>=6)", "pytest-black (>= [metadata] lock-version = "2.0" python-versions = ">=3.8,<3.13" -content-hash = "5a9c2757ded08c2dd057e86dbb904e4c712f71d99a1613b18967b82bc793935d" +content-hash = "2e2a0282f988d9173d2da2955365ac6a7439210a8ad2a69103815b029803bc3a" diff --git a/pyproject.toml b/pyproject.toml index e43408ce..954bea1e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ bleak-winrt = { version = "^1.2.0", markers = "platform_system=='Windows'", pyth "winrt-Windows.Foundation" = { version = "2.0.0b1", allow-prereleases = true, markers = "platform_system=='Windows'", python = ">=3.12" } "winrt-Windows.Foundation.Collections" = { version = "2.0.0b1", allow-prereleases = true, markers = "platform_system=='Windows'", python = ">=3.12" } "winrt-Windows.Storage.Streams" = { version = "2.0.0b1", allow-prereleases = true, markers = "platform_system=='Windows'", python = ">=3.12" } -dbus-fast = { version = "^1.83.0", markers = "platform_system == 'Linux'" } +dbus-fast = { version = ">=1.83.0, < 3", markers = "platform_system == 'Linux'" } [tool.poetry.group.docs.dependencies] Sphinx = "^5.1.1" From dbf92f52c56b00fca79e285de9eeac99337c6806 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Fri, 8 Sep 2023 17:57:52 -0500 Subject: [PATCH 09/10] v0.21.1 --- CHANGELOG.rst | 6 +++++- pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f8fdb946..1ff57550 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,6 +10,9 @@ and this project adheres to `Semantic Versioning "] license = "MIT" From 054b092e19c7a45d5ea07d8948022f54117fe5e8 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Fri, 8 Sep 2023 17:59:16 -0500 Subject: [PATCH 10/10] fix issue number --- CHANGELOG.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1ff57550..31068be2 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -15,7 +15,7 @@ and this project adheres to `Semantic Versioning