diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index c8135ae..9f8d6c9 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - python: ['3.9', '3.10', '3.11', '3.12', '3.13'] + python: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.15'] env: VIRTUAL_ENV: .venv steps: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c397359..d268e97 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - python: ['3.9', '3.10', '3.11', '3.12', '3.13'] + python: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.15'] env: VIRTUAL_ENV: .venv steps: diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c85c697 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Caches: +__pycache__/ diff --git a/hid_parser/__init__.py b/hid_parser/__init__.py index 448d46f..77eb2c4 100644 --- a/hid_parser/__init__.py +++ b/hid_parser/__init__.py @@ -782,20 +782,11 @@ def _append_items( ) self._append_item(offset_list, pool, report_id, item) else: - if len(usages) != report_count: - error_str = f'Expecting {report_count} usages but got {len(usages)}' - warnings.warn(HIDComplianceWarning(error_str), stacklevel=2) - if len(usages) > report_count: - report_count = len(usages) - else: - missing_usage_count = report_count - len(usages) - usages += [] * missing_usage_count - - for usage in usages: + for r in range(0, report_count): item = VariableItem( offset=offset_list[report_id], size=report_size, - usage=usage, + usage=usages[min(r, len(usages) - 1)], flags=flags, **data, ) diff --git a/noxfile.py b/noxfile.py index a3d5a56..d78d28e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -18,7 +18,7 @@ def mypy(session): session.run('mypy', '-p', 'hid_parser') -@nox.session(python=['3.9', '3.10', '3.11', '3.12', '3.13']) +@nox.session(python=['3.9', '3.10', '3.11', '3.12', '3.13', '3.14', '3.15']) def test(session): htmlcov_output = os.path.join(session.virtualenv.location, 'htmlcov') xmlcov_output = os.path.join(session.virtualenv.location, f'coverage-{session.python}.xml')