greatscottgadgets / python-usb-protocol

python library providing utilities, data structures, constants, parsers, and tools for working with USB data
BSD 3-Clause "New" or "Revised" License
55 stars 32 forks source link

Import, syntax fixes (with some mypy help) #27

Closed sarnold closed 8 months ago

sarnold commented 2 years ago

Howdy: found this while working on some USB hardware projects, and it seemed like an interesting tool (and learning experience) but the current state needed a few fixes, mainly imports and missing commas (where the latter includes some trailing commas to help with merge/patch sanity). That said, USB protocols aren't really my thing, so I still have some questions about the proper/correct internal imports between types and emitters and between UAC and MIDI modules. Thanks!

Currently:

(.venv) python-usb-protocol (import-fixes) $ mypy --follow-imports=error --non-interactive --install-types usb_protocol
Success: no issues found in 23 source files

and:

(.venv) python-usb-protocol (import-fixes) $ python -m unittest discover
................
----------------------------------------------------------------------
Ran 16 tests in 0.009s

OK

Note that test discovery is currently broken due to duplicate names being dropped, as it should find 42 tests.

sarnold commented 2 years ago

Basic tox config using nosetest to run each file with "import unittest" does "work" but it can't find all the sources and the coverage is fubared.

antoinevg commented 8 months ago

My apologies for the interruption, normal operations are resuming :-)

Can you please remove the CI additions (.coveragerc, setup.cfg, tox.ini) from the PR?

We're in the process of configuring the repo for GSG's existing CI infrastructure.

antoinevg commented 8 months ago

This is a great PR, thank you muchly!