Skip to content

Commit ac8d4ca

Browse files
committed
contrib and setup test
1 parent e2c685f commit ac8d4ca

10 files changed

Lines changed: 459 additions & 4 deletions

File tree

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Bug report
2+
description: Something isn't working as documented
3+
labels: ["bug"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for the report. This library wraps the `hackrf-tools` binaries, so
9+
please include tool/OS details — most issues are environment-specific.
10+
11+
If this involves **transmitting**, do not include instructions that would
12+
help someone operate illegally; describe the software behavior only.
13+
- type: textarea
14+
id: what-happened
15+
attributes:
16+
label: What happened
17+
description: What did you expect, and what happened instead?
18+
validations:
19+
required: true
20+
- type: textarea
21+
id: repro
22+
attributes:
23+
label: Steps to reproduce
24+
description: The exact command or minimal code. Include `print_cmd=True` / `--print-cmd` output if relevant.
25+
render: shell
26+
validations:
27+
required: true
28+
- type: input
29+
id: os
30+
attributes:
31+
label: Operating system
32+
placeholder: "e.g. Windows 11 23H2 / Ubuntu 24.04 / macOS 14"
33+
validations:
34+
required: true
35+
- type: input
36+
id: python
37+
attributes:
38+
label: Python version
39+
placeholder: "output of: python --version"
40+
validations:
41+
required: true
42+
- type: input
43+
id: hackrfpy
44+
attributes:
45+
label: hackrfpy version
46+
placeholder: "output of: pip show hackrfpy | grep Version"
47+
validations:
48+
required: true
49+
- type: textarea
50+
id: tools
51+
attributes:
52+
label: hackrf-tools / firmware version
53+
description: Paste the output of `hackrf_info` (redact serial numbers if you wish).
54+
render: shell
55+
validations:
56+
required: false
57+
- type: dropdown
58+
id: hardware
59+
attributes:
60+
label: Was a HackRF board connected?
61+
options:
62+
- "Yes, a real board was connected"
63+
- "No, this reproduces without hardware"
64+
- "Not sure"
65+
validations:
66+
required: true
67+
- type: textarea
68+
id: logs
69+
attributes:
70+
label: Logs / traceback
71+
description: Full traceback or stderr output. Run with `verbose=True` / `-v` if possible.
72+
render: shell

‎.github/ISSUE_TEMPLATE/config.yml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Official HackRF documentation
4+
url: https://hackrf.readthedocs.io/
5+
about: Authoritative reference for device behavior, valid ranges, and TX safety. Check here first.
6+
- name: HackRF firmware & tools (Great Scott Gadgets)
7+
url: https://github.com/greatscottgadgets/hackrf
8+
about: Report firmware, libhackrf, or hackrf-tools issues upstream — not here.
9+
- name: Question / usage help
10+
url: https://github.com/LC-Linkous/hackRF_python/discussions
11+
about: For "how do I..." questions, open a Discussion rather than an issue.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Feature request
2+
description: Suggest a new capability or improvement
3+
labels: ["enhancement"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Before filing: **signal processing (demod, FFTs, waterfalls) is out of
9+
scope** for this repo — it stops at delivering `complex64`. See
10+
`project_summary.md` for the split with the planned DSP project.
11+
- type: textarea
12+
id: problem
13+
attributes:
14+
label: Problem / use case
15+
description: What are you trying to do that the library doesn't currently support?
16+
validations:
17+
required: true
18+
- type: textarea
19+
id: proposal
20+
attributes:
21+
label: Proposed solution
22+
description: What would the method / CLI command / behavior look like? A sketch of the signature is helpful.
23+
validations:
24+
required: false
25+
- type: dropdown
26+
id: area
27+
attributes:
28+
label: Area
29+
options:
30+
- Receive / capture
31+
- Sweep
32+
- Transmit
33+
- Info / preflight / detect
34+
- Device management (clock/operacake/spiflash/debug)
35+
- Decoding / file helpers / SigMF
36+
- CLI
37+
- Docs / examples
38+
- Other
39+
validations:
40+
required: true
41+
- type: textarea
42+
id: alternatives
43+
attributes:
44+
label: Alternatives considered
45+
description: Existing workarounds, or why the passthrough methods (`clock`/`operacake`/`debug`) don't cover it.
46+
validations:
47+
required: false

‎.github/PULL_REQUEST_TEMPLATE.md‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<!-- Thanks for contributing to hackrfpy. Keep PRs focused: one logical change. -->
2+
3+
## Summary
4+
5+
<!-- What does this change and why? Link the issue it closes. -->
6+
Closes #
7+
8+
## Type of change
9+
10+
- [ ] Bug fix
11+
- [ ] New command / feature
12+
- [ ] Docs / examples
13+
- [ ] Test / CI / tooling
14+
- [ ] Refactor (no behavior change)
15+
16+
## How it was tested
17+
18+
- [ ] `uv run pytest -m "not hardware"` passes locally
19+
- [ ] `uv run ruff check .` and `uv run ruff format --check .` pass
20+
- [ ] Tested against **real hardware** (describe below)
21+
- [ ] Tested with **stubs only** (no board)
22+
23+
<!-- If real hardware: which board, firmware, and hackrf-tools version? -->
24+
25+
## Checklist for new/changed commands
26+
27+
- [ ] Binary invocation goes through `_run(argv, mode=...)` (no direct subprocess)
28+
- [ ] Added a command-construction test asserting the exact `hackrf_*` argv via `print_cmd`
29+
- [ ] Added a validation-error test asserting **nothing runs** on bad input
30+
- [ ] Any new envelope limits live in `constants.py`, not hard-coded in the method
31+
- [ ] Process-lifecycle changes covered with the cross-platform stub factory (`tests/conftest.py`)
32+
- [ ] README Method Reference updated; example added under `examples/` if it's a public method
33+
34+
## Notes for reviewers
35+
36+
<!-- Anything tricky, follow-ups intentionally left out, etc. -->

‎.github/workflows/tests.yml‎

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
# Cancel superseded runs on the same ref (saves CI minutes on rapid pushes).
10+
concurrency:
11+
group: tests-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
defaults:
15+
run:
16+
# The installable project lives in the hackrfpy/ subdirectory (the one with
17+
# pyproject.toml + the pytest config + the `hardware` marker).
18+
working-directory: hackrfpy
19+
20+
jobs:
21+
test:
22+
name: pytest (${{ matrix.os }}, py${{ matrix.python-version }})
23+
runs-on: ${{ matrix.os }}
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
# windows-latest is first because it is the platform this library
28+
# targets; the cross-platform lifecycle stubs must pass there.
29+
os: [windows-latest, ubuntu-latest, macos-latest]
30+
python-version: ["3.11", "3.12", "3.13"]
31+
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- name: Install uv
36+
uses: astral-sh/setup-uv@v5
37+
with:
38+
enable-cache: true
39+
python-version: ${{ matrix.python-version }}
40+
41+
- name: Sync environment (numpy + dev group, editable install)
42+
run: uv sync
43+
44+
- name: Run test suite (hardware tests deselected)
45+
run: uv run pytest -m "not hardware" --cov=hackrfpy --cov-report=xml --cov-report=term-missing
46+
47+
- name: Upload coverage to Codecov
48+
# Optional: only runs once linked at https://codecov.io. Tokenless for
49+
# public repos. Safe to leave in before linking - it just no-ops/soft-fails.
50+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
51+
uses: codecov/codecov-action@v5
52+
with:
53+
files: hackrfpy/coverage.xml
54+
fail_ci_if_error: false
55+
56+
lint:
57+
name: ruff + mypy
58+
runs-on: ubuntu-latest
59+
steps:
60+
- uses: actions/checkout@v4
61+
62+
- name: Install uv
63+
uses: astral-sh/setup-uv@v5
64+
with:
65+
enable-cache: true
66+
python-version: "3.12"
67+
68+
- name: Sync environment
69+
run: uv sync
70+
71+
- name: Ruff lint
72+
run: uv run ruff check .
73+
74+
- name: Ruff format check
75+
run: uv run ruff format --check .
76+
77+
- name: Mypy
78+
# Non-blocking for now: flip `continue-on-error` to false once the
79+
# type surface is clean and you want mypy to gate merges.
80+
continue-on-error: true
81+
run: uv run mypy src/hackrfpy

‎CITATION.cff‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ authors:
1313
- family-names: "Linkous"
1414
given-names: "Lauren"
1515
orcid: "https://orcid.org/0000-0001-9945-5125"
16-
version: "0.1.0"
17-
date-released: "2026-06-15"
16+
version: "1.0.0"
17+
date-released: "2026-06-16"
1818
license: GPL-2.0-or-later
1919
repository-code: "https://github.com/LC-Linkous/hackRF_python"
2020
url: "https://github.com/LC-Linkous/hackRF_python"
@@ -26,4 +26,4 @@ keywords:
2626
- rf
2727
- spectrum
2828
- sigmf
29-
- instrumentation
29+
- instrumentation

‎CODE_OF_CONDUCT.md‎

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity and
10+
orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment:
18+
19+
- Demonstrating empathy and kindness toward other people
20+
- Being respectful of differing opinions, viewpoints, and experiences
21+
- Giving and gracefully accepting constructive feedback
22+
- Accepting responsibility and apologizing to those affected by our mistakes,
23+
and learning from the experience
24+
- Focusing on what is best for the overall community
25+
26+
Examples of unacceptable behavior:
27+
28+
- The use of sexualized language or imagery, and sexual attention or advances of
29+
any kind
30+
- Trolling, insulting or derogatory comments, and personal or political attacks
31+
- Public or private harassment
32+
- Publishing others' private information, such as a physical or email address,
33+
without their explicit permission
34+
- Other conduct which could reasonably be considered inappropriate in a
35+
professional setting
36+
37+
## Enforcement Responsibilities
38+
39+
Community leaders are responsible for clarifying and enforcing our standards of
40+
acceptable behavior and will take appropriate and fair corrective action in
41+
response to any behavior that they deem inappropriate, threatening, offensive,
42+
or harmful.
43+
44+
## Scope
45+
46+
This Code of Conduct applies within all community spaces, and also applies when
47+
an individual is officially representing the community in public spaces.
48+
49+
## Enforcement
50+
51+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
52+
reported to the project maintainers responsible for enforcement via the repo's
53+
private reporting channels (see SECURITY.md) or by opening a confidential report
54+
through GitHub. All complaints will be reviewed and investigated promptly and
55+
fairly.
56+
57+
## Attribution
58+
59+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
60+
version 2.1, available at
61+
https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.
62+
63+
[homepage]: https://www.contributor-covenant.org

0 commit comments

Comments
 (0)