Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General refactor/restructure of the project #361

Merged
merged 5 commits into from
Apr 7, 2023
Merged

Conversation

klaasnicolaas
Copy link
Owner

@klaasnicolaas klaasnicolaas commented Mar 29, 2023

General restructure/refactor of the project.

  • Updates all sub-dependencies
  • Replace flake + all plugins + isort + pyupgrade + bandit by ruff
  • Address all issues raised by ruff
  • Simplify GitHub actions runs, to have a little fewer jobs/faster runtimes and leverage caching capabilities of other actions
  • Remove old configs no longer in use
  • Put TCP test in new file

@klaasnicolaas klaasnicolaas added the refactor Improvement of existing code, not introducing new features. label Mar 29, 2023
@klaasnicolaas
Copy link
Owner Author

The list of issues to smash 😄
image

* Fix remainder of ruff lints

* Revert TCP error messages

General communication messages for read and write are caught and raised
during `wait_closed()`.

* Attempt to fix missing coverage on 108->exit

* Ignore `PGH003` for type skip

* use `type: ignore[unreachable]` instead

* Fix coverage by moving `self._close_session=False` out of `if`

Somehow `codecov` is not able to deduce that `_close_session` is `False`
if the `if` was not entered.

* Improve and reuse `close()` function

* Ignore type-less subclass with `misc` instead of `unreachable` ignore

The type is still reachable, `mypy` simply doesn't have type info hence
considers it as the `Any` type which shouldn't be subclassed:

    tests/test_tcp_models.py:206: error: Unused "type: ignore" comment
    tests/test_tcp_models.py:206: error: Class cannot subclass "TestCase" (has type "Any")  [misc]
    tests/test_tcp_models.py:206: note: Error code "misc" not covered by "type: ignore" comment

* Make content_type check less strict again
@klaasnicolaas klaasnicolaas changed the title WIP General refactor/restructure of the project General refactor/restructure of the project Apr 7, 2023
@codecov
Copy link

codecov bot commented Apr 7, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (2e1f0ff) 100.00% compared to head (8e61ee0) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #361   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          327       343   +16     
  Branches        55        54    -1     
=========================================
+ Hits           327       343   +16     
Impacted Files Coverage Δ
omnikinverter/models.py 100.00% <100.00%> (ø)
omnikinverter/omnikinverter.py 100.00% <100.00%> (ø)
omnikinverter/tcp.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

tests/test_omnik.py Outdated Show resolved Hide resolved
@klaasnicolaas klaasnicolaas merged commit 355f809 into main Apr 7, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Apr 9, 2023
@klaasnicolaas klaasnicolaas deleted the klaas-2023-002 branch February 13, 2024 15:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
refactor Improvement of existing code, not introducing new features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants