Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
with:
path: ~/.cargo
key: cargo-lint-${{ hashFiles('**/*.rs') }}
- run: cargo clippy
- run: cargo clippy -p examples
- run: cargo clippy -- -D warnings
- run: cargo clippy -p examples -- -D warnings
- run: cargo fmt --check --all

lint-typescript:
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ crate-type = ["cdylib"]

[dependencies]
embedded-hal = "1.0.0"
pyo3 = {version = "0.25.1", features = ["extension-module"]}
pyo3 = {version = "0.26.0", features = ["extension-module", "abi3-py39"]}
rf24-rs = { path = "../../crates/rf24-rs", features = ["std"]}
rf24ble-rs = { path = "../../crates/rf24ble-rs", features = ["std"] }

Expand Down
8 changes: 5 additions & 3 deletions bindings/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ To build from source, the [rf24-rs] project uses [uv] to manage dependencies:
uv sync
```

Append `--no-dev` for environments with limited disk space (eg. Raspberry Pi machine).
Append `--no-dev` (or set `UV_NO_DEV=1` environment variable) for environments with limited disk space (eg. Raspberry Pi machine).
As of [uv] v0.8.7, the environment variable

[uv]: https://docs.astral.sh/uv

Expand All @@ -49,8 +50,9 @@ To run the examples, simply pass the example file's path to the python interpret
uv run examples/python/getting_started.py
```

Again, the `--no-dev` argument can be applied to the `uv run` command for
environments with limited disk space.
Again, the `--no-dev` argument can be applied to the `uv run` command
(or set `UV_NO_DEV=1` environment variable)
for environments with limited disk space.

The examples/python/irq_config.py script requires the [gpiod] package.
The `uv run` command needs to be amended to include this dependency:
Expand Down
6 changes: 3 additions & 3 deletions bindings/python/src/fake_ble/radio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl FakeBle {
/// This function should not be called in RX mode. To ensure proper radio behavior,
/// the caller must ensure that the radio is in TX mode.
pub fn hop_channel(&mut self) -> PyResult<()> {
Python::with_gil(|py| {
Python::attach(|py| {
let mut radio = self.radio.bind(py).borrow_mut();
let channel = radio.get_channel()?;
if let Some(channel) = BleChannels::increment(channel) {
Expand Down Expand Up @@ -151,7 +151,7 @@ impl FakeBle {
/// | `1` | `0xFF` |
/// | `2 ... n - 1` | custom data |
pub fn send(&mut self, buf: &[u8]) -> PyResult<bool> {
Python::with_gil(|py| {
Python::attach(|py| {
let mut radio = self.radio.bind(py).borrow_mut();
if let Some(tx_queue) = self.inner.make_payload(
buf,
Expand Down Expand Up @@ -185,7 +185,7 @@ impl FakeBle {
/// If the payload was somehow malformed or incomplete,
/// then this function returns an `None` value.
pub fn read(&mut self) -> PyResult<Option<BlePayload>> {
Python::with_gil(|py| {
Python::attach(|py| {
let mut radio = self.radio.bind(py).borrow_mut();
let mut buf = [0u8; 32];
buf.copy_from_slice(&radio.read(Some(32))?);
Expand Down
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@ include = [

[dependency-groups]
dev = [
"maturin==1.9.2",
"maturin==1.9.4",
"mypy==1.17.1",
"pre-commit==4.2.0",
"ruff==0.12.7",
"pre-commit==4.3.0",
"ruff==0.12.11",
]
docs = [
"markdown-gfm-admonition==0.1.1",
"mkdocs==1.6.1",
"mkdocs-include-markdown-plugin==7.1.6",
"mkdocs-material==9.6.16",
"mkdocstrings-python==1.16.12",
"mkdocs-include-markdown-plugin==7.1.7",
"mkdocs-material==9.6.18",
"mkdocstrings-python==1.18.2",
"pymdown-extensions==10.16.1",
]
Loading
Loading