Wykres commitów

859 Commity (d50eef989a4c8a7ed95eb25ce948e70e85b4c15c)

Autor SHA1 Wiadomość Data
Marius Kriegerowski d50eef989a Fix mutable in signature 2021-03-21 16:46:41 +01:00
Marius Kriegerowski 57bdd45321 remove complexity checks 2021-03-17 10:57:32 +01:00
Marius Kriegerowski 613e77f6b4 more strict flake8. Fixed typos. 2021-03-17 10:57:32 +01:00
Marius Kriegerowski 2c1b425820 add contributing.md and .pre-commit-config.yaml 2021-03-17 10:27:56 +01:00
Florian Ludwig b72a389e6c use brokwer_uri default in client connection 2021-03-16 10:59:26 +01:00
Florian Ludwig 560eed263b cleanup BrokerContext.sessions 2021-03-16 10:59:26 +01:00
Florian Ludwig f328f8ca90 add more type hints 2021-03-16 10:59:26 +01:00
Florian Ludwig f3d7fa90f3 cleanup broker.start 2021-03-16 10:59:26 +01:00
Florian Ludwig 9f35a20b78 replace not_in_dict_or_none with more pythonic check 2021-03-16 10:59:26 +01:00
Florian Ludwig 14b54d830f cleanup utils.gen_client_id 2021-03-16 10:59:26 +01:00
Florian Ludwig 9069f9bc14 fix return type of decode_string 2021-03-16 10:59:26 +01:00
Florian Ludwig bfd515d31a fix formatting of badges 2021-03-16 08:45:24 +01:00
Florian Ludwig 384c43dcd0 add pypi badges 2021-03-16 08:45:24 +01:00
lrasku c41b01499d Fix topic filter matching
- re.escape() the whole filter string first to escape _all_ regex
  metacharacters in it, not just $. (# and + are both regex metacharacters,
  so their replace expressions now need a leading \\ to replace the
  escaping, too.)
- # matches topics both with and without a trailing /, so the replace
  expressions adds a '?' before the '.*'. The .lstrip('?') at the end removes
  this in case the # was the first character in the filter.
- + should only match a single level, but it should _also_ match empty levels,
  so use '[^/]*' to replace it.
- Use Regex.fullmatch() to match against the whole topic string, not just
  its start.

Also add two unit tests to test this matching, and fix an incorrect match
against + in test_client_subscribe_publish_dollar_topic_2.
2021-03-15 13:43:47 +01:00
Marius Kriegerowski 7921e2cc22 linter project with black at default line length 88 2021-03-15 10:18:00 +01:00
lrasku 8e8aafd33e Make WebSockets work with IPv6 addresses
WebSocketsWriter.get_peer_info() naively returns just
self._protocol.remote_address, but this is a 4-tuple in IPv6,
which will raise ValueErrors when client code tries to unpack
it into two elements. Fortunately the first two elements of the
tuple are the same as in IPv4 and should be all that we need
(get_peer_info() is currently only used for logging), so just
return a 2-prefix of the value instead.
2021-03-15 10:16:50 +01:00
Marius Kriegerowski db3dffa857 use black linter with 96 char line length 2021-03-14 21:44:41 +01:00
lrasku 295418a11f Permit connect() and reconnect() coroutines to be cancelled
The plain `except BaseException` statement used in the two coroutines
also matches asyncio.CancelledError and thus prevents them from
being cancelled. Prepend a simple re-raising except block for
asyncio.CancelledError to get them to work with task cancellation.
2021-03-14 16:55:29 +01:00
Florian Ludwig 87d19c5342 prepare second alpha release: 0.10.0-alpha.1 2021-03-13 18:28:01 +01:00
Florian Ludwig 112fc959f4 don't keep changelog per pre-release 2021-03-13 18:28:01 +01:00
Florian Ludwig b16450cf71 more consistent release naming 2021-03-13 18:28:01 +01:00
Florian Ludwig 009986efbc automaticlally set version in Sphinx from release 2021-03-13 18:28:01 +01:00
Florian Ludwig df1696d8f9 update author and url 2021-03-13 18:28:01 +01:00
Florian Ludwig 0868d06fd3 remove setup.cfg 2021-03-13 18:28:01 +01:00
Florian Ludwig 0bebf6a675 migrate to aMQTT name 2021-03-13 18:28:01 +01:00
Florian Ludwig a290080417 update python version requirements 2021-03-13 18:28:01 +01:00
Florian Ludwig 3c5256e50f remove tracking from docs 2021-03-13 18:28:01 +01:00
Florian Ludwig e829bfd353 update changelog 2021-03-13 18:28:01 +01:00
Florian Ludwig 97a9d4715a update gitignore 2021-03-13 18:28:01 +01:00
Florian Ludwig a4655ddf25 tox and travis are not used anymore 2021-03-13 18:28:01 +01:00
Florian Ludwig 6f47441fdd cleanup versioning system 2021-03-13 17:02:50 +01:00
Florian Ludwig 836fa0e049 prepare 0.10.0 release 2021-03-13 17:02:50 +01:00
Stein Magnus Jodal b85774439e Move scripts module into hbmqtt module
Fixes #166
2021-03-13 15:58:25 +01:00
Florian Ludwig a19f37dac7 setup coveralls 2021-03-13 15:57:39 +01:00
Florian Ludwig 71a2713ef2 update copyright 2021-03-13 15:57:29 +01:00
Florian Ludwig 2c5404c521 fixup 2021-03-13 15:57:29 +01:00
Florian Ludwig ddd413687e README update 2021-03-13 15:57:29 +01:00
Florian Ludwig 4a9594e6f3 fix TopicTabooPlugin for anonymous users
Thanks to https://github.com/JNevrly
See also https://github.com/beerfactory/hbmqtt/pull/151
2021-03-10 10:20:22 +01:00
Girts Folkmanis 7cd230e6b2 Pass in loop to PluginManager
If `loop` is passed to `MQTTClient`, previously it was not passed down
to `PluginManager`, which could potentially grab a different loop from
`asyncio.get_event_loop()`, resulting in a separate event loop being
created or wrong one being used. Now the `loop` argument is passed down
as expected.
2021-03-10 10:09:10 +01:00
Florian Ludwig ab2084190e install pytest-asyncio in CI 2021-03-09 19:13:32 +01:00
Florian Ludwig f439ccd1b1 reaplce some more assertEqual 2021-03-09 19:13:32 +01:00
Florian Ludwig 7c56c9caba migrate test_client to pytest 2021-03-09 19:13:32 +01:00
Florian Ludwig 7276075ed8 move broker into pytest fixture 2021-03-09 19:13:32 +01:00
Florian Ludwig b430cc8487 replace assertTrue 2021-03-09 19:13:32 +01:00
Florian Ludwig 5c58fcd59c rework broker tests to use pytest-asyncio 2021-03-09 19:13:32 +01:00
Florian Ludwig c631cc7895 run tests for python 3.8 and 3.9 2021-03-09 19:13:32 +01:00
Marius Kriegerowski 1e11e30457 add python3.9 to supported version 2021-03-09 19:13:32 +01:00
Marius Kriegerowski 0e594582d1 add python3.8 to environment 2021-03-09 19:13:32 +01:00
Marius Kriegerowski 30582f4cac Revert "Fixed critical bugs e.g., incorrectly retained messages on qos0, race conditions on detached sessions, eliminated set_exception on client disconnect tasks, a few debug log message isEnabledFor wrappers."
This reverts commit 1f5efd383f.
2021-03-09 19:13:32 +01:00
Marius Kriegerowski 7b7d17b789 fix async lock call 2021-03-09 19:13:32 +01:00