Skip to content

Commit 89530bd

Browse files
authored
Significant refactor (#3)
- switch to a single module package structure - lite variant removed as Arduino framework is preferred for size requirements on ATSAMD21 (using CirquePinnacle lib) - add new classes `AbsoluteReport` and `RelativeReport` - `RelativeReport` includes a `buffer` read-only property that returns a `bytes` object (convenient for mouse HID reports). - change `read()` to return `AbsoluteReport`, `RelativeReport`, or `None` (depending on `data_mode`) - updates docs and CI workflows (including pre-commit config) - updated examples now show usage for each supported `data_mode` (& as a USB mouse example).
1 parent e6aca69 commit 89530bd

21 files changed

+1527
-1455
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -46,30 +46,6 @@ jobs:
4646
- name: Pre-commit hooks
4747
run: pre-commit run --all-files
4848

49-
# test-coverage:
50-
# runs-on: ubuntu-latest
51-
# steps:
52-
# - uses: actions/checkout@v3
53-
54-
# - uses: actions/setup-python@v4
55-
# with:
56-
# python-version: "3.x"
57-
58-
# - name: Install testing tools
59-
# run: pip install -r requirements.txt -r tests/requirements.txt
60-
61-
# - name: Collect coverage
62-
# run: |
63-
# coverage run -m pytest
64-
# coverage report
65-
# coverage xml
66-
67-
# - name: Upload coverage reports to Codecov
68-
# uses: codecov/codecov-action@v3
69-
# with:
70-
# files: ./coverage.xml
71-
# verbose: true # optional (default = false)
72-
7349
build-bundles:
7450
runs-on: ubuntu-latest
7551
steps:
@@ -82,14 +58,6 @@ jobs:
8258
tr '_' '-'
8359
) >> $GITHUB_OUTPUT
8460
85-
- name: Translate Repo Name For Build Tools package_prefix
86-
id: pkg-name
87-
run: |
88-
echo pkg-name=$(
89-
echo ${{ github.repository }} |
90-
awk -F '\/' '{ print tolower($2) }'
91-
) >> $GITHUB_OUTPUT
92-
9361
- uses: actions/checkout@v3
9462

9563
- name: Set up Python 3.x
@@ -108,7 +76,7 @@ jobs:
10876
source actions-ci/install.sh
10977
11078
- name: Build assets
111-
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --package_folder_prefix ${{ steps.pkg-name.outputs.pkg-name }} --library_location .
79+
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
11280

11381
- name: Archive bundles
11482
uses: actions/upload-artifact@v3

.github/workflows/release.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ jobs:
1818
tr '_' '-'
1919
) >> $GITHUB_OUTPUT
2020
21-
- name: Translate Repo Name For Build Tools package_prefix
22-
id: pkg-name
23-
run: |
24-
echo pkg-name=$(
25-
echo ${{ github.repository }} |
26-
awk -F '\/' '{ print tolower($2) }'
27-
) >> $GITHUB_OUTPUT
28-
2921
- name: Set up Python 3.x
3022
uses: actions/setup-python@v4
3123
with:
@@ -47,7 +39,7 @@ jobs:
4739
source actions-ci/install.sh
4840
4941
- name: Build assets
50-
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --package_folder_prefix ${{ steps.pkg-name.outputs.pkg-name }} --library_location .
42+
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
5143

5244
- name: Archive bundles
5345
if: github.event_name == 'workflow_dispatch'

.pre-commit-config.yaml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
repos:
22
- repo: https://github.com/python/black
3-
rev: 22.8.0
3+
rev: 23.1.0
44
hooks:
55
- id: black
66
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: v4.3.0
7+
rev: v4.4.0
88
hooks:
99
- id: check-yaml
1010
- id: end-of-file-fixer
1111
- id: trailing-whitespace
1212
- repo: https://github.com/pycqa/pylint
13-
rev: v2.15.3
13+
rev: v2.17.0
1414
hooks:
1515
- id: pylint
1616
name: pylint (library code)
@@ -25,17 +25,9 @@ repos:
2525
types: [python]
2626
files: "^examples/"
2727
args:
28-
- --disable=missing-docstring,invalid-name,consider-using-f-string,duplicate-code,import-error
29-
- id: pylint
30-
name: pylint (test code)
31-
description: Run pylint rules on "tests/*.py" files
32-
types: [python]
33-
additional_dependencies: [pytest]
34-
files: "^tests/"
35-
args:
36-
- --disable=import-error,invalid-name,protected-access,too-few-public-methods
28+
- --disable=missing-docstring,invalid-name,consider-using-f-string,duplicate-code,import-error,unused-import
3729
- repo: https://github.com/pre-commit/mirrors-mypy
38-
rev: v0.981
30+
rev: v1.1.1
3931
hooks:
4032
- id: mypy
4133
name: mypy (library code)

0 commit comments

Comments
 (0)