Skip to content

Commit

Permalink
Significant refactor (#3)
Browse files Browse the repository at this point in the history
- 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).
  • Loading branch information
2bndy5 committed Apr 21, 2023
1 parent e6aca69 commit 89530bd
Show file tree
Hide file tree
Showing 21 changed files with 1,527 additions and 1,455 deletions.
34 changes: 1 addition & 33 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,30 +46,6 @@ jobs:
- name: Pre-commit hooks
run: pre-commit run --all-files

# test-coverage:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3

# - uses: actions/setup-python@v4
# with:
# python-version: "3.x"

# - name: Install testing tools
# run: pip install -r requirements.txt -r tests/requirements.txt

# - name: Collect coverage
# run: |
# coverage run -m pytest
# coverage report
# coverage xml

# - name: Upload coverage reports to Codecov
# uses: codecov/codecov-action@v3
# with:
# files: ./coverage.xml
# verbose: true # optional (default = false)

build-bundles:
runs-on: ubuntu-latest
steps:
Expand All @@ -82,14 +58,6 @@ jobs:
tr '_' '-'
) >> $GITHUB_OUTPUT
- name: Translate Repo Name For Build Tools package_prefix
id: pkg-name
run: |
echo pkg-name=$(
echo ${{ github.repository }} |
awk -F '\/' '{ print tolower($2) }'
) >> $GITHUB_OUTPUT
- uses: actions/checkout@v3

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

- name: Archive bundles
uses: actions/upload-artifact@v3
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ jobs:
tr '_' '-'
) >> $GITHUB_OUTPUT
- name: Translate Repo Name For Build Tools package_prefix
id: pkg-name
run: |
echo pkg-name=$(
echo ${{ github.repository }} |
awk -F '\/' '{ print tolower($2) }'
) >> $GITHUB_OUTPUT
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
Expand All @@ -47,7 +39,7 @@ jobs:
source actions-ci/install.sh
- name: Build assets
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --package_folder_prefix ${{ steps.pkg-name.outputs.pkg-name }} --library_location .
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .

- name: Archive bundles
if: github.event_name == 'workflow_dispatch'
Expand Down
18 changes: 5 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
repos:
- repo: https://github.com/python/black
rev: 22.8.0
rev: 23.1.0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pycqa/pylint
rev: v2.15.3
rev: v2.17.0
hooks:
- id: pylint
name: pylint (library code)
Expand All @@ -25,17 +25,9 @@ repos:
types: [python]
files: "^examples/"
args:
- --disable=missing-docstring,invalid-name,consider-using-f-string,duplicate-code,import-error
- id: pylint
name: pylint (test code)
description: Run pylint rules on "tests/*.py" files
types: [python]
additional_dependencies: [pytest]
files: "^tests/"
args:
- --disable=import-error,invalid-name,protected-access,too-few-public-methods
- --disable=missing-docstring,invalid-name,consider-using-f-string,duplicate-code,import-error,unused-import
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.981
rev: v1.1.1
hooks:
- id: mypy
name: mypy (library code)
Expand Down
Loading

0 comments on commit 89530bd

Please sign in to comment.