Closed vincentdavis closed 9 months ago
Just made a few updates to fix doc test and test annotations
Do you have pre-commit installed? It catches the same errors as found by the CI here, but locally.
See https://bluetooth-numbers.readthedocs.io/en/stable/contributing.html#clone-the-repository for the installation.
Do you have pre-commit installed? It catches the same errors as found by the CI here, but locally.
See https://bluetooth-numbers.readthedocs.io/en/stable/contributing.html#clone-the-repository for the installation.
I am working on that right now.
@koenvervloesem Kinda struggling with the pre-commit. I have a lot of it cleaned up. I don't think I have everything installed to fully run the pre-commit and my editor, Pycharm, is not using ruff configuration correctly. It's not giving me the hints and warnings or fixing the import sorting as I expect.
I don't seem to have all the type hints correct, but again not getting clear information from Pycharm as to whats wrong.
I am kinda stuck and out of time for now.
Maybe a development requirements file would be helpful?
Thanks already for the work you did! I'll take a look at the pre-commit errors tomorrow and see what I can fix. Maybe we can also ignore some of the errors if they're too pedantic.
I added some comments, these should solve/ignore most of the errors. But have a look at the doctests too.
I added some comments, these should solve/ignore most of the errors. But have a look at the doctests too.
Ok, I have cleaned up most of this, I'll finish up later today.
Ok, just one issue with the import order (see above), and the two doctest issues I reviewed, and then this looks ready to merge.
I think it's ready.
The interrogate
pre-commit does not work for me locally. I like the idea of what it does. Maybe using Ruff's pydocstyle would be simpler and sufficient.
https://docs.astral.sh/ruff/rules/#pydocstyle-d
If you click on Details next to the failing tests, there are still some issues. Could you take a look at them? Once these tests run successfully, we can merge this PR.
@koenvervloesem looking at the failing doc test, not sure what I am doing wrong. Is it sensitive to whitespace (2 lines vs 1 line?
Failed example:
rl.lookup("Power Feature", uuid_types=['characteristic'],logic="SUBSTR")
Expected:
{Match(uuid=10853, description='Cycling Power Feature',
uuid_type='characteristic')}
Got:
{Match(uuid=10853, description='Cycling Power Feature', uuid_type='characteristic')}
Yes, and the solution is the # doctest: +NORMALIZE_WHITESPACE
I was talking about in https://github.com/koenvervloesem/bluetooth-numbers/pull/43#discussion_r1423619840
So this example should look like:
>>> rl.lookup("Power Feature", uuid_types=['characteristic'],
... logic="SUBSTR") # doctest: +NORMALIZE_WHITESPACE
{Match(uuid=10853, description='Cycling Power Feature',
uuid_type='characteristic')}
Thanks for your patience
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
59465e8
) 100.00% compared to head (05a456e
) 100.00%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Perfect! Now only the code coverage check complains, but the type checking line should be ignored. You can solve this by adding the following lines at the end of .coveragerc
:
# Assume if TYPE_CHECKING is covered
if TYPE_CHECKING:
Thanks for patiently fixing your code to follow the project's code style!
Issue #42, reverse lookup I have implemented this as a class that initiates from the UUID dicts. I did it this way rather than writing the index to a file for two reasons; 1: it's fast enough, 2: In the future, we might want to add the ability to rebuild the index incases where the user adds custom UUIDs. Feedback appreciated. I am not very familiar with taking full advantage of pytest.