Skip to content

Commit

Permalink
build: install Bleak by default on Linux
Browse files Browse the repository at this point in the history
As Bleak is soon to become the default adapter on Linux, install Bleak
by default for the benefit of Linux users, both current and future.
For future Bleak users this makes testing and adoption easier when the
module is pre-installed.
  • Loading branch information
terop authored and ttu committed Jul 27, 2024
1 parent 3fdb4e0 commit 1696212
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Changelog

### [Unreleased]
* ADD: Install Bleak automatically on all platforms

## [2.3.1] - 2024-03-10
* ADD: Bluez as option to RUUVI_BLE_ADAPTER environment variable
Expand Down
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,15 +445,10 @@ In case of errors, the application tries to exit immediately, so it can be autom

### Bleak

On Windows and macOS Bleak is installed and used automatically with `ruuvitag-sensor` package.
Bleak is automatically installed with `ruuvitag-sensor` package on all platforms.
On Windows and macOS it is automatically used with `ruuvitag-sensor` package.

On Linux install it manually from PyPI and enable it with `RUUVI_BLE_ADAPTER` environment variable.

```sh
$ python -m pip install bleak
```

Add environment variable RUUVI_BLE_ADAPTER with value Bleak. E.g.
To enable Bleak use the `RUUVI_BLE_ADAPTER` environment variable as shown below.

```sh
$ export RUUVI_BLE_ADAPTER="bleak"
Expand All @@ -467,7 +462,7 @@ import os
os.environ["RUUVI_BLE_ADAPTER"] = "bleak"
```

Bleak supports only async methods.
Bleak only supports asynchronous methods.

```py
import asyncio
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies = [
"ptyprocess;platform_system=='Linux'",
"mypy-extensions;python_version<'3.8'",
"importlib-metadata<4.3,>=1.1.0;python_version<'3.8'",
"bleak;platform_system=='Windows' or platform_system=='Darwin'",
"bleak",
]

[project.optional-dependencies]
Expand Down Expand Up @@ -87,4 +87,4 @@ line_length = 120
ensure_newline_before_comments = true

[tool.black]
line-length = 120
line-length = 120

0 comments on commit 1696212

Please sign in to comment.