Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

siliconrig-0.2.1.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

siliconrig-0.2.1-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file siliconrig-0.2.1.tar.gz.

File metadata

  • Download URL: siliconrig-0.2.1.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for siliconrig-0.2.1.tar.gz
Algorithm Hash digest
SHA256 67397779188926cf105b10cb709d3e26dbeb0a780fe1fa0c73cde047d39efaee
MD5 f77657748cad9ecef9c759a3b1f29c90
BLAKE2b-256 9a1ca253b8520a9bd8c9146ce0185e829974b7285a4be843efceba6b184d14e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for siliconrig-0.2.1.tar.gz:

Publisher: publish.yml on siliconrig/srig-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file siliconrig-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: siliconrig-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for siliconrig-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9f402f2aa7d1da7308e98347bf0608b9f1128c07745ed66721533484c7c9be9c
MD5 002a0fcc71cbac2b0144309004346fde
BLAKE2b-256 a18f1c2f0bd6e0ae4493c51e8ebc1d67653d51a4bd39b173f4a4fb7a424e8e82

See more details on using hashes here.

Provenance

The following attestation bundles were made for siliconrig-0.2.1-py3-none-any.whl:

Publisher: publish.yml on siliconrig/srig-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page