Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: empicano/aiomqtt
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.1.0
Choose a base ref
...
head repository: empicano/aiomqtt
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: GitHub discussions
url: https://github.com/empicano/aiomqtt/discussions
about: Ask (and answer) questions, brainstorm, and show what you've built.
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Open an issue
about: Report a problem or discuss a new feature
---

<!--
Thank you for taking the time to report an issue! We're glad to have you involved with aiomqtt.
If you're filing a bug report, please consider including the following information:
- The version of aiomqtt
- A minimal self-contained code snippet that reproduces the bug (you can use `test.mosquitto.org` for a publicly available MQTT broker)
- Possibly related issues
-->
33 changes: 14 additions & 19 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
name: Documentation

on:
push:
branches: [main]
paths:
- "docs/**"
- "aiomqtt/**"
- README.md
- .github/workflows/docs.yml
pull_request:
paths:
- "docs/**"
- "aiomqtt/**"
- README.md
- .github/workflows/docs.yml

jobs:
docs:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
contents: read
pages: write
id-token: write
defaults:
run:
shell: bash
@@ -43,12 +38,12 @@ jobs:
run: scripts/setup
- name: Build documentation
run: scripts/docs
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
- name: Upload artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build
publish_branch: documentation
user_name: "github-actions[bot]"
user_email: "github-actions[bot]@users.noreply.github.com"
path: docs/_build
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
id: deployment
uses: actions/deploy-pages@v4
8 changes: 3 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
name: Publish

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
environment:
name: pypi
url: https://pypi.org/project/aiomqtt
permissions:
id-token: write
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@v3
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: Tests

on:
push:
branches: [main]
pull_request:

jobs:
test:
strategy:
95 changes: 41 additions & 54 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -6,6 +6,27 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [2.3.0] - 2024-08-07

### Added

- Implement `len(client.messages)` to return number of messages in queue (@empicano in #323)

### Changed

- Update FastAPI docs to use dependency injection (@odie5533 in #321)

## [2.2.0] - 2024-07-02

### Changed

- Bump paho-mqtt to 2.1 (@empicano in #305)
- Migrate to paho-mqtt callback v2 (@empicano in #313)

### Fixed

- Fix `Client.messages` not being reusable (@ryan-summers in #312)

## [2.1.0] - 2024-04-24

### Changed
@@ -32,16 +53,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Switch from black to Ruff and update dev dependencies (@JonathanPlasse in #255)
- Rename `Client.id` attribute to `identifier` (@empicano in #262)

### Fixed

- Release reusability correctly to allow consecutive calls to `__aexit__` (@spacemanspiff2007 in #263)

### Removed

- Remove deprecated `connect`/`disconnect` methods (@empicano in #262)
- Remove deprecated `filtered_messages` and `unfiltered_messages` methods (@empicano in #262)
- Remove deprecated `message_retry_set` client argument (@empicano in #262)

### Fixed

- Release reusability correctly to allow consecutive calls to `__aexit__` (@spacemanspiff2007 in #263)

## [1.2.1] - 2023-09-19

### Changed
@@ -197,11 +218,8 @@ Yanked. We recently renamed the project from asyncio-mqtt to aiomqtt. Problem is
### Fixed

- Fix race condition in the "advanced example" in `README.md`. Contributed by [Steve Palmer (@steverpalmer)](https://github.com/steverpalmer) in [#93](https://github.com/sbtinstruments/asyncio-mqtt/pull/93)

- Make `password` keyword argument optional (as it always should have been). Contributed by [@Shikoruma](https://github.com/Shikoruma) in [#89](https://github.com/sbtinstruments/asyncio-mqtt/pull/89)

- Fix false postive type error from Pyright regarding `asynccontextmanager`. Contributed by [Shawn Wilsher (@sdwilsh)](https://github.com/sdwilsh) in [#87](https://github.com/sbtinstruments/asyncio-mqtt/pull/87)

- Fix false positive type error from Pyright regarding `asynccontextmanager`. Contributed by [Shawn Wilsher (@sdwilsh)](https://github.com/sdwilsh) in [#87](https://github.com/sbtinstruments/asyncio-mqtt/pull/87)
- Fix type hints (mostly related to async_generator). Contributed by [@laundmo](https://github.com/laundmo) in [#86](https://github.com/sbtinstruments/asyncio-mqtt/pull/86)

## [0.11.0] - 2021-11-04
@@ -223,11 +241,8 @@ Yanked. We recently renamed the project from asyncio-mqtt to aiomqtt. Problem is
### Added

- Add new parameter `socket_options` to `Client.__init__`. Contributed by [@xydan83](https://github.com/xydan83) in [#71](https://github.com/sbtinstruments/asyncio-mqtt/pull/71)

- Add new parameter `message_retry_set` to `Client.__init__`. Contributed by [@xydan83](https://github.com/xydan83) in [#69](https://github.com/sbtinstruments/asyncio-mqtt/pull/69)

- Export `ProtocolVersion` from the main module. Contributed by [André (@tropxy)](https://github.com/tropxy) in [#65](https://github.com/sbtinstruments/asyncio-mqtt/pull/65) (1/2)

- Add documentation about publishers, client arguments, etc. Contributed by [André (@tropxy)](https://github.com/tropxy) in [#65](https://github.com/sbtinstruments/asyncio-mqtt/pull/65) (2/2)

### Fixed
@@ -239,71 +254,50 @@ Yanked. We recently renamed the project from asyncio-mqtt to aiomqtt. Problem is
### Fixed

- Fix handling of MQTTv5 reason codes. Contributed by [Jakob Schlyter (@jschlyter)](https://github.com/jschlyter) in [#59](https://github.com/sbtinstruments/asyncio-mqtt/pull/59)

- Account for `-1` socket handles in the close callback. Contributed by [@wrobell](https://github.com/wrobell) in [#60](https://github.com/sbtinstruments/asyncio-mqtt/pull/60)

## [0.9.0] - 2021-05-03

### Added

- Add type hints. Contributed by [Ellis Percival (@flyte)](https://github.com/flyte) in [#37](https://github.com/sbtinstruments/asyncio-mqtt/pull/37)

- Add the `keepalive`, `bind_address`, `bind_port`, `clean_start`, `properties` arguments. Contributed by [Marcin Jaworski (@yawor)](https://github.com/yawor) in [#56](https://github.com/sbtinstruments/asyncio-mqtt/pull/56)

### Fixed

- Fix Python 3.6 compatibility. Contributed by [(@fipwmaqzufheoxq92ebc)](https://github.com/fipwmaqzufheoxq92ebc) in [#57](https://github.com/sbtinstruments/asyncio-mqtt/pull/57).
Note that asyncio-mqtt officially targets Python 3.7. Compatibility with 3.6 is community-driven.

- Fix Python 3.6 compatibility. Contributed by [(@fipwmaqzufheoxq92ebc)](https://github.com/fipwmaqzufheoxq92ebc) in [#57](https://github.com/sbtinstruments/asyncio-mqtt/pull/57). Note that asyncio-mqtt officially targets Python 3.7. Compatibility with 3.6 is community-driven.
- Fix "Broken pipe" error. Contributed by [Gilbert (@gilbertsmink)](https://github.com/gilbertsmink) in [#55](https://github.com/sbtinstruments/asyncio-mqtt/pull/55)

- Fix socket check when you select the WebSocket transport. Contributed by [Robert Chmielowiec (@chmielowiec)](https://github.com/chmielowiec) in [#54](https://github.com/sbtinstruments/asyncio-mqtt/pull/54)

- Fix `TypeError` on invalid username and password combination

- Check that \_misc_task is not None before trying to cancel it. Contributed by [Ellis Percival (@flyte)](https://github.com/flyte) in [#41](https://github.com/sbtinstruments/asyncio-mqtt/pull/41)

- Fix exception in `on_socket_open`: Non-thread-safe operation invoked on an event loop other than the current one. Contributed by [Ellis Percival (@flyte)](https://github.com/flyte) in [#40](https://github.com/sbtinstruments/asyncio-mqtt/pull/40)

## [0.8.1] - 2021-02-23

### Fixed

- Fix `AttributeError` when you use WebSockets.
Contributed by [Robert Chmielowiec (@chmielowiec)](https://github.com/chmielowiec) in [#36](https://github.com/sbtinstruments/asyncio-mqtt/pull/36)

- Fix `asyncio.InvalidStateError` in the `_on_connect` callback.
Contributed by [Maxim Shmalovsky (@vitalalerter)](https://github.com/vitalalerter) in [#31](https://github.com/sbtinstruments/asyncio-mqtt/pull/31)

- Fix "Future exception was never retrieved" on disconnect.
Contributed by [Martin Hjelmare (@martinhjelmare)](https://github.com/martinhjelmare) in [#25](https://github.com/sbtinstruments/asyncio-mqtt/pull/25)

- Fix `connect` so it no longer blocks the event loop.
Contributed by [Øystein Haug Olsen (@oholsen)](https://github.com/oholsen) in [#23](https://github.com/sbtinstruments/asyncio-mqtt/pull/23)
- Fix `AttributeError` when you use WebSockets. Contributed by [Robert Chmielowiec (@chmielowiec)](https://github.com/chmielowiec) in [#36](https://github.com/sbtinstruments/asyncio-mqtt/pull/36)
- Fix `asyncio.InvalidStateError` in the `_on_connect` callback. Contributed by [Maxim Shmalovsky (@vitalalerter)](https://github.com/vitalalerter) in [#31](https://github.com/sbtinstruments/asyncio-mqtt/pull/31)
- Fix "Future exception was never retrieved" on disconnect. Contributed by [Martin Hjelmare (@martinhjelmare)](https://github.com/martinhjelmare) in [#25](https://github.com/sbtinstruments/asyncio-mqtt/pull/25)
- Fix `connect` so it no longer blocks the event loop. Contributed by [Øystein Haug Olsen (@oholsen)](https://github.com/oholsen) in [#23](https://github.com/sbtinstruments/asyncio-mqtt/pull/23)

## [0.8.0] - 2020-11-09

### Added

- Add `transport` argument to `Client`
Contributed by [@opengs](https://github.com/opengs) in [#21](https://github.com/sbtinstruments/asyncio-mqtt/pull/21)
- Add `clean_session` argument to `Client`
Contributed by [@nadyka](https://github.com/madnadyka) in [#17](https://github.com/sbtinstruments/asyncio-mqtt/pull/17)
- Add `transport` argument to `Client`. Contributed by [@opengs](https://github.com/opengs) in [#21](https://github.com/sbtinstruments/asyncio-mqtt/pull/21)
- Add `clean_session` argument to `Client`. Contributed by [@nadyka](https://github.com/madnadyka) in [#17](https://github.com/sbtinstruments/asyncio-mqtt/pull/17)

## [0.7.0] - 2020-08-04

I've tested the library for production use at SBT Instruments.
This uncovered a bunch of bugs and missing features that I've adressed
in this release. We are approaching a 1.0.0 release. Let me know
if you want something changed before that via the issue tracker on GitHub.
I've tested the library for production use at SBT Instruments. This uncovered a bunch of bugs and missing features that I've addressed in this release. We are approaching a 1.0.0 release. Let me know if you want something changed before that via the issue tracker on GitHub.

### Added

- Add support for MQTTv5.
- Add `will` keyword argument to `Client`.
- Add `MqttConnectError` with specific error messages for connection failures.
- Add `Client.id` property that returns the client ID (or `None` if
the client ID was not specified during construction).
- Add `Client.id` property that returns the client ID (or `None` if the client ID was not specified during construction).

### Fixed

@@ -312,25 +306,20 @@ if you want something changed before that via the issue tracker on GitHub.
- Fix compatibility with `asyncqt`'s event loop.
- Fix race condition in `Client.connect` that raised an `AttributeError`.
- Fix "[asyncio] Future exception was never retrieved" debug message.
- Fix support for python 3.6.
Contributed by [Derrick Lyndon Pallas (@pallas)](https://github.com/pallas) in [#12](https://github.com/sbtinstruments/asyncio-mqtt/pull/12)
- Fix support for python 3.6. Contributed by [Derrick Lyndon Pallas (@pallas)](https://github.com/pallas) in [#12](https://github.com/sbtinstruments/asyncio-mqtt/pull/12)

## [0.6.0] - 2020-06-26

### Changed

- No longer logs exception in `Client.__aexit__`. It's perfectly valid
to exit due to, e.g., `asyncio.CancelledError` so let's not treat it as an
error.
- No longer logs exception in `Client.__aexit__`. It's perfectly valid to exit due to, e.g., `asyncio.CancelledError` so let's not treat it as an error.

## [0.5.0] - 2020-06-08

### Added

- Add support for python 3.6.
Contributed by [Derrick Lyndon Pallas (@pallas)](https://github.com/pallas) in [#7](https://github.com/sbtinstruments/asyncio-mqtt/pull/7) (1/2).
- Add `client_id` and `tls_context` keyword arguments to the `Client` constructor.
Contributed by [Derrick Lyndon Pallas (@pallas)](https://github.com/pallas) in [#7](https://github.com/sbtinstruments/asyncio-mqtt/pull/7) (2/2).
- Add support for python 3.6. Contributed by [Derrick Lyndon Pallas (@pallas)](https://github.com/pallas) in [#7](https://github.com/sbtinstruments/asyncio-mqtt/pull/7) (1/2).
- Add `client_id` and `tls_context` keyword arguments to the `Client` constructor. Contributed by [Derrick Lyndon Pallas (@pallas)](https://github.com/pallas) in [#7](https://github.com/sbtinstruments/asyncio-mqtt/pull/7) (2/2).
- Add `timeout` keyword argument to both `Client.connect` and `Client.disconnect`. Default value of `10` seconds (like the other functions).

### Changed
@@ -353,8 +342,7 @@ if you want something changed before that via the issue tracker on GitHub.

### Added

- Add `username` and `password` keyword arguments to the `Client` constructor.
Contributed by [@gluap](https://github.com/gluap) in [#1](https://github.com/sbtinstruments/asyncio-mqtt/pull/1).
- Add `username` and `password` keyword arguments to the `Client` constructor. Contributed by [@gluap](https://github.com/gluap) in [#1](https://github.com/sbtinstruments/asyncio-mqtt/pull/1).

### Fixed

@@ -364,8 +352,7 @@ if you want something changed before that via the issue tracker on GitHub.

### Fixed

- Fix regression with the `Client._wait_for` helper method introduced in the latest
release.
- Fix regression with the `Client._wait_for` helper method introduced in the latest release.

## [0.2.0] - 2020-04-07

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# How to contribute

We're very happy about contributions to aiomqtt!
We're very happy about contributions to aiomqtt! 🎉

## Development setup

Loading