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
77 changes: 77 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Bug report
description: Something isn't working as documented
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thanks for the report. This library talks to real hardware over serial,
so please include device and OS details — many issues are
firmware- or environment-specific.

For questions about **device behavior** (not this library), the
[official tinySA wiki](https://tinysa.org/wiki/) and the tinySA
community at groups.io are the right places — they do not support this
library, and library issues belong here, not there.
- type: textarea
id: what-happened
attributes:
label: What happened
description: What did you expect, and what happened instead?
validations:
required: true
- type: textarea
id: repro
attributes:
label: Steps to reproduce
description: The exact minimal code. Include the command string the library sent if you have it (set_verbose(True) output helps).
render: python
validations:
required: true
- type: input
id: os
attributes:
label: Operating system
placeholder: "e.g. Windows 11 23H2 / Ubuntu 24.04 / macOS 14"
validations:
required: true
- type: input
id: python
attributes:
label: Python version
placeholder: "output of: python --version"
validations:
required: true
- type: input
id: tsapython
attributes:
label: tsapython version
placeholder: "output of: pip show tsapython | grep Version (or 'local build from <commit>')"
validations:
required: true
- type: dropdown
id: device
attributes:
label: Device model
options:
- tinySA (Basic)
- tinySA Ultra
- tinySA Ultra+
- "No device connected (reproduces without hardware)"
- Other / not sure
validations:
required: true
- type: textarea
id: firmware
attributes:
label: Device firmware / info
description: Paste the output of `tsa.info()` if a device is involved (redact the serial if you wish).
render: shell
validations:
required: false
- type: textarea
id: logs
attributes:
label: Logs / traceback
description: Full traceback or output. Run with `set_verbose(True)` and `set_error_byte_return(True)` if possible.
render: shell
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Official tinySA documentation
url: https://tinysa.org/wiki/
about: Authoritative reference for device behavior, valid ranges, and safe operation. Check here first.
- name: tinySA community (groups.io)
url: https://groups.io/g/tinysa
about: Device-usage questions belong here. Note they do NOT support this library — library issues stay on this repo.
62 changes: 62 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Feature request
description: Suggest a new capability or improvement
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
Before filing: this is deliberately a **non-GUI** API. GUI features are
out of scope. New device commands are in scope — note that the
`command()` function already provides raw access to any serial command,
so a request for a wrapped method is a request for validation, parsing,
and documentation around it.
- type: textarea
id: problem
attributes:
label: Problem / use case
description: What are you trying to do that the library doesn't currently support?
validations:
required: true
- type: textarea
id: proposal
attributes:
label: Proposed solution
description: What would the method / behavior look like? A sketch of the signature is helpful.
validations:
required: false
- type: dropdown
id: area
attributes:
label: Area
options:
- Acquisition (scan / sweep / data)
- Markers / traces
- Levels / gain
- Output / signal generator
- Calibration
- Display / UI commands
- Presets / config
- System info / connection / autodetect
- Docs / examples
- Other
validations:
required: true
- type: dropdown
id: devices
attributes:
label: Which device(s) does this apply to?
options:
- All tinySA models
- tinySA (Basic)
- tinySA Ultra
- tinySA Ultra+
- Not sure
validations:
required: false
- type: textarea
id: alternatives
attributes:
label: Alternatives considered
description: Existing workarounds, or why the raw `command()` passthrough doesn't cover it.
validations:
required: false
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Question / usage help
description: How do I use this library to do something?
labels: ["question"]
body:
- type: markdown
attributes:
value: |
For questions about **this library** (tsapython). Questions about the
tinySA device itself are better answered by the
[official wiki](https://tinysa.org/wiki/) and the
[tinySA community](https://groups.io/g/tinysa) — they know the hardware
far better, but do not support this library.
- type: textarea
id: question
attributes:
label: What are you trying to do?
description: The goal, plus what you've tried so far (code welcome).
validations:
required: true
- type: input
id: setup
attributes:
label: Setup
placeholder: "e.g. tinySA Ultra, Windows 11, Python 3.12, tsapython 3.0.0"
validations:
required: false
35 changes: 35 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!-- Thanks for contributing to tinySA_python. Keep PRs focused: one logical change. -->

## Summary

<!-- What does this change and why? Link the issue it closes. -->
Closes #

## Type of change

- [ ] Bug fix
- [ ] New command / feature
- [ ] Docs / examples
- [ ] Test / CI / tooling
- [ ] Refactor (no behavior change)

## How it was tested

- [ ] `uv run pytest -m "not hardware"` passes locally (from the `tsapython/` directory)
- [ ] `uv run ruff check .` passes
- [ ] Tested against a **real device** (describe below)
- [ ] Tested with the **mocked fixtures only** (no device)

<!-- If real hardware: which model (Basic / Ultra / Ultra+) and firmware version (from info())? -->

## Checklist for new/changed commands

- [ ] Device writes go through `tinySA_serial()` (no direct `self.ser` access from command methods)
- [ ] Added a command-construction test asserting the exact command string via the `recorder` fixture
- [ ] Added a validation-error test asserting **nothing is sent** on bad input
- [ ] Response parsing (if any) is tested with the `fake_port` fixture, ideally against captured device bytes
- [ ] README command reference updated; example added under `examples/` if it's a significant public method

## Notes for reviewers

<!-- Anything tricky, follow-ups intentionally left out, etc. -->
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,31 @@ on:
workflow_dispatch: # allows manual runs from the Actions tab

jobs:
test:
# A release cannot ship with a red suite: the build/publish jobs below
# depend on this passing. Single-platform here for speed; the full
# cross-platform matrix runs on every push via tests.yml.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Sync environment
run: uv sync
working-directory: tsapython

- name: Run test suite
run: uv run pytest -m "not hardware"
working-directory: tsapython

- name: Lint + type check
run: uv run ruff check . && uv run mypy
working-directory: tsapython

build:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
95 changes: 95 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Tests

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

# Cancel superseded runs on the same ref (saves CI minutes on rapid pushes).
concurrency:
group: tests-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
# The installable project lives in the tsapython/ subdirectory (the one with
# pyproject.toml, the pytest config, and the `hardware` marker).
working-directory: tsapython

jobs:
test:
name: pytest (${{ matrix.os }}, py${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# The library is pyserial-based and developed on Windows, lightly
# tested on Linux -- so both matter; macOS is cheap to include.
os: [windows-latest, ubuntu-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ matrix.python-version }}

- name: Sync environment (deps + dev group, editable install)
run: uv sync

- name: Run test suite (hardware tests deselected)
run: uv run pytest -m "not hardware" --cov=tsapython --cov-report=xml --cov-report=term-missing

- name: Upload coverage to Codecov
# Optional: only does anything once the repo is linked at
# https://codecov.io. Tokenless for public repos. Safe to leave in
# before linking -- it soft-fails.
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
uses: codecov/codecov-action@v5
with:
files: tsapython/coverage.xml
fail_ci_if_error: false

lint:
name: ruff + mypy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: "3.12"

- name: Sync environment
run: uv sync

- name: Ruff lint
# Blocking ruleset is E9 + F only (see [tool.ruff.lint] in
# pyproject.toml); style rules are a planned follow-up cleanup.
run: uv run ruff check .

- name: Mypy
# Blocking. The package ships a py.typed marker, which promises
# downstream type-checkers that these annotations are real; this gate
# is what keeps that promise true.
run: uv run mypy

build:
name: package builds
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Build sdist + wheel
# Catches packaging breakage on every push instead of at release time.
# release.yml does the same build when publishing.
run: uv build
Loading
Loading