Python SDK and pytest fixtures for siliconrig hardware-in-the-loop testing
Project description
siliconrig
Python SDK for siliconrig — remote access to MCU development boards.
Use it in scripts, automation, or as a pytest plugin for hardware-in-the-loop testing.
Install
pip install siliconrig
Quick start
from siliconrig import Client
client = Client()
with client.session(board="esp32s3") as session:
session.flash("firmware.bin")
session.serial.expect("Ready", timeout=10)
session.serial.send("status\n")
print(session.serial.read_until("OK", timeout=5))
Or use the Board shorthand:
from siliconrig import Board
with Board("esp32-s3", firmware="build/app.bin") as board:
board.expect("System ready", timeout=5)
board.send("gpio set 4 1\n")
board.expect("GPIO4=HIGH", timeout=2)
pytest plugin
The package includes a pytest plugin that registers automatically. Use it with custom fixtures:
import pytest
from siliconrig import Board
@pytest.fixture
def board():
with Board("esp32-s3", firmware="build/app.bin") as b:
yield b
def test_boot_ok(board):
assert board.expect("System ready", timeout=5)
Or use the built-in siliconrig_board fixture via CLI options:
pytest --siliconrig-board esp32s3 --siliconrig-firmware build/app.bin tests/hil/
Authentication
Set your API key via environment variable:
export SRIG_API_KEY=key_...
Or pass it directly:
client = Client(api_key="key_...")
Documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file siliconrig-0.2.0.tar.gz.
File metadata
- Download URL: siliconrig-0.2.0.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ab2e401033d24e91828ce4b14794a2c5ee55b55229084f90af1b4b02248d7a8
|
|
| MD5 |
794242aea1204dceeebac4fd3c5fc1d7
|
|
| BLAKE2b-256 |
dc9fff4f8ae568d6bc5bc8a2b7847c32ac8ee81406457ca3b07a78feb80d284d
|
Provenance
The following attestation bundles were made for siliconrig-0.2.0.tar.gz:
Publisher:
publish.yml on siliconrig/srig-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
siliconrig-0.2.0.tar.gz -
Subject digest:
4ab2e401033d24e91828ce4b14794a2c5ee55b55229084f90af1b4b02248d7a8 - Sigstore transparency entry: 1242166589
- Sigstore integration time:
-
Permalink:
siliconrig/srig-python@188e159f9d8055c75fab0898798ed2d784e4c11b -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/siliconrig
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@188e159f9d8055c75fab0898798ed2d784e4c11b -
Trigger Event:
release
-
Statement type:
File details
Details for the file siliconrig-0.2.0-py3-none-any.whl.
File metadata
- Download URL: siliconrig-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c617db40912d0e084c142936af945fc57b3ade25cd25229aa875807e0db5532a
|
|
| MD5 |
b9f43857b489775901f201e1663c83d7
|
|
| BLAKE2b-256 |
e43f67fc4e9294abe48ec5672367c793953895b37428810a8606352b71cae2b1
|
Provenance
The following attestation bundles were made for siliconrig-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on siliconrig/srig-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
siliconrig-0.2.0-py3-none-any.whl -
Subject digest:
c617db40912d0e084c142936af945fc57b3ade25cd25229aa875807e0db5532a - Sigstore transparency entry: 1242166646
- Sigstore integration time:
-
Permalink:
siliconrig/srig-python@188e159f9d8055c75fab0898798ed2d784e4c11b -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/siliconrig
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@188e159f9d8055c75fab0898798ed2d784e4c11b -
Trigger Event:
release
-
Statement type: