-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
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
Change matrix component to use matrix-nio instead of matrix_client #72797
Conversation
Hi @PaarthShah, It seems you haven't yet signed a CLA. Please do so here. Once you do that we will be able to review and accept this pull request. Thanks! |
Hey there @tinloaf, mind taking a look at this pull request as it has been labeled with an integration ( |
Hey @arychj! Apologies for pinging you directly, but I've seen that you've also done some recent work with the I was wondering if you/@Kane610 (since I saw they also reviewed matrix-related changes) could take a look at this PR and offer any advice for getting this merged! Would be happy to talk on another platform as desired. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please verify that past conversations are resolved? Currently, there are still four open.
@edenhaus I've marked each of the past 4 (and your 2 most-recent) conversations as resolved: they were mainly along the lines of general discussion, and since-resolved comments from [@]balloob from before when I knew I should've just marked them resolved on my own :^) |
You don't need to ping me on the process :) When you have addressed all changes, please mark the PR as ready for review, and the bot will ask for a review from me. |
Apologies! Since it was a comment that couldn't itself be marked as resolved I wasn't sure of the etiquette 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor changes to improve the readability of the test.
Sanity check @PaarthShah During the check, i found the following line https://github.com/poljar/matrix-nio/blob/0.21.2/nio/api.py#L51-L52. Probably a historic left over |
Oof yeah, I've made a long laundry list of cleanup tasks for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @PaarthShah 👍
Proposed change
This PR introduces a new dependency, matrix-nio, as a replacement for the obsolete
matrix_client
.asyncio
operations to greatly speed up operations involving network I/O.matrix-nio
as "both more featureful and more actively maintained".Furthermore, this PR aimed to validate the dependency upgrade by introducing new unit tests (was previously NOT tested) and python type hinting. Currently, I've achieved 97% code coverage of the component code.
Type of change
Additional information
THIS SHOULD NOT BE A BREAKING CHANGE.
Every effort was taken to maintain (and test!) all previous functionality, with the exception of exact code logic (and resulting logging statements) used to achieve it.
I have deliberately not done any refactoring of existing code except as to take advantage of newer python syntax or to support best testing practices. If such cleanup is desired, I can perform it in this PR, or in a separate PR.
I have also deliberately not implemented Config Flow, in order to keep PR size down. Its implementation, along with other matrix-specific features, are in my future plans.
I am happy to explain any apparent functionality difference, or fix it if it is actually incorrectly replicating existing behavior.
Though I have checked multiple boxes under
Type of change
, this was done solely in light of how thematrix
component currently does not have any unit tests, and I thought it would be prudent/appropriate to include such tests while making such a reaching change.If, before/during review it is requested to split the dependency upgrade and addition of unit tests into separate PRs, I am happy to do so.
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: