Skip to content

Commit cb92a8a

Browse files
committed
Refactor PythonExamples to add configuration and unit tests
1 parent 0827a8d commit cb92a8a

22 files changed

Lines changed: 2609 additions & 352 deletions

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: CI
2+
3+
on:
4+
push: {}
5+
pull_request: {}
6+
workflow_dispatch:
7+
8+
jobs:
9+
lint-and-test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- uses: prefix-dev/setup-pixi@v0.9.4
15+
with:
16+
cache: ${{ !env.ACT }}
17+
18+
- name: Run pre-commit
19+
run: pixi run pre-commit run --all-files
20+
21+
- name: Unit tests
22+
run: pixi run test

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.pyc
2+
push.json
3+
.pytest_cache/

.pre-commit-config.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# See https://pre-commit.com for usage. All hooks limited to PythonExample/.
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v5.0.0
5+
hooks:
6+
- id: trailing-whitespace
7+
files: ^PythonExample/
8+
- id: end-of-file-fixer
9+
files: ^PythonExample/
10+
exclude: \.pytest_cache
11+
- id: check-yaml
12+
files: ^PythonExample/
13+
- id: check-added-large-files
14+
args: ["--maxkb=1000"]
15+
files: ^PythonExample/
16+
- id: check-merge-conflict
17+
files: ^PythonExample/
18+
19+
- repo: https://github.com/astral-sh/ruff-pre-commit
20+
rev: v0.8.4
21+
hooks:
22+
- id: ruff
23+
args: [--fix]
24+
files: ^PythonExample/
25+
26+
- repo: local
27+
hooks:
28+
- id: pytest
29+
name: pytest
30+
entry: bash -c 'cd PythonExample && PYTHONPATH= pixi run python -m pytest tests/ -v'
31+
language: system
32+
pass_filenames: false
33+
files: ^PythonExample/

ArduinoExample/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,3 @@ Rx arduino pin connected to Tx pin on TTLinker / Tx arduino pin connected to Rx
3535
![Arduino_Mega_PortCom](../assets/Arduino_Mega.jpg)
3636

3737
Rx and Tx pin used on arduino Mega are RX1 & TX1 (19 & 18)
38-
39-

0 commit comments

Comments
 (0)