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

Add basic client #14

Closed
wants to merge 36 commits into from
Closed

Add basic client #14

wants to merge 36 commits into from

Conversation

dostuffthatmatters
Copy link
Member

@dostuffthatmatters dostuffthatmatters commented Sep 11, 2023

Moved to #21

Remove dummy data script - this will be located in a separate repository
Add static type pytest
Add github actions workflow to test client for different python versions
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Sep 11, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 441b929
Status: ✅  Deploy successful!
Preview URL: https://d54d65b8.tenta.pages.dev
Branch Preview URL: https://development-moritz.tenta.pages.dev

View logs

@dostuffthatmatters dostuffthatmatters force-pushed the development-moritz branch 2 times, most recently from 7c2330b to 290c9bd Compare September 11, 2023 21:04
Start implementing client class
Add option to block during message sending
Add more comments to example script
Refactor publish API, add measurement publishing
Add acknowledgement publishing
Make message timestamps configurable
@empicano
Copy link
Member

Ping me when it's ready for review 😉

Add script to start an MQTT broker in a docker container
This broker has password authentication which cannot be tested with the
`test.mosquitto.org` broker
Implement readable error messages on connection failure
Test various connection failures/success
Add `on_config_message` and `on_publish` callbacks
Add more comments
Refactor client class
Use `connection_timeout` argument to make tests fail faster
Extend example code with callbacks
Write script that converts example code into markdown file
Update example code and conversion script
Use public MQTT broker, debug static types
Test TLS support in connection tests
Remove unused local mosquitto docker broker
Add TLS to example
Improve TLS args docs
Rename `revision` parameter to `config_revision`
Order pytests (static type tests first)
Add documentation generation
Update documentation
Write test that checks whether documentation is up to date
Add test for config receiving
Add mosquitto dependencies to CI workflow
Add publishing test to improve coverage
Convert instance variables to class variables in order
to sync the state between threads
Update TLS Protocol in Example
Possibly debug race conditions during publishing
@dostuffthatmatters
Copy link
Member Author

dostuffthatmatters commented Sep 13, 2023

Hi, @empicano! I think it is ready for review :)

Some comments:

  • The connection to the broker test.mosquitto.org is tested with an unencrypted instance and with an TLS-exncrypted one. I chose the style of aiomqtt and pass the tls settings directly to paho
  • I was careful that the only non-optional dependency is paho
  • client/example.py is copied over to docs/pages/user-guide/python-client-example.mdx and the comments are interpreted as markdown. This way I can check the static types. See https://development-moritz.tenta.pages.dev/user-guide/python-client-example
  • I used pydoc-markdown to automatically generate the API reference. This generation does not run in the website build-CI because it requires a Python environment which I really don't want to configure in that CI. Hence, there is a pytest that checks whether the generated markdowns (example and API reference) are up to date. See https://development-moritz.tenta.pages.dev/api-reference/python-client-api
  • I am testing strict static types, connection success and failure with various failure reasons, publishing, and config receiving and it is at 94% coverage now :)

I am looking forward to your comments!

EDIT: I just noticed that only the __init__ docstring is in the Google Docstring format, but the others are not yet. I will update that tomorrow.
EDIT 2: The docstrings are all in Google style now :)

Update docstrings and remove `TentaClient.reset` method
Fix returns in docstrings
Add comment about long connection time on wrong ports
Add `py.typed` file
Fix typos in client and example code
Restructure `ConfigMessage` and `TLSParameters` class so that they are
rendered in the API reference as well
@dostuffthatmatters
Copy link
Member Author

@dostuffthatmatters dostuffthatmatters deleted the development-moritz branch September 15, 2023 12:13
@dostuffthatmatters
Copy link
Member Author

dostuffthatmatters commented Sep 15, 2023

It closed the PR, when I renamed the branch, sorry ^^ I will open a new one at #21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants