From 1d100e5c4534b77833deee0c2393029b3dec7490 Mon Sep 17 00:00:00 2001 From: Florian Ludwig Date: Sat, 27 Mar 2021 13:18:13 +0100 Subject: [PATCH] rename entry_points --- amqtt/broker.py | 4 ++-- amqtt/client.py | 2 +- docs/references/broker.rst | 4 ++-- pyproject.toml | 31 ++++++++++++++++--------------- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/amqtt/broker.py b/amqtt/broker.py index 61d8de8..6c0df9f 100644 --- a/amqtt/broker.py +++ b/amqtt/broker.py @@ -148,7 +148,7 @@ class Broker: :param config: Example Yaml config :param loop: asyncio loop to use. Defaults to ``asyncio.get_event_loop()``. - :param plugin_namespace: Plugin namespace to use when loading plugin entry_points. Defaults to ``hbmqtt.broker.plugins`` + :param plugin_namespace: Plugin namespace to use when loading plugin entry_points. Defaults to ``amqtt.broker.plugins`` """ @@ -190,7 +190,7 @@ class Broker: if plugin_namespace: namespace = plugin_namespace else: - namespace = "hbmqtt.broker.plugins" + namespace = "amqtt.broker.plugins" self.plugins_manager = PluginManager(namespace, context, self._loop) def _build_listeners_config(self, broker_config): diff --git a/amqtt/client.py b/amqtt/client.py index 3f54bba..bb5038f 100644 --- a/amqtt/client.py +++ b/amqtt/client.py @@ -124,7 +124,7 @@ class MQTTClient: context = ClientContext() context.config = self.config self.plugins_manager = PluginManager( - "hbmqtt.client.plugins", context, loop=self._loop + "amqtt.client.plugins", context, loop=self._loop ) self.client_tasks = deque() diff --git a/docs/references/broker.rst b/docs/references/broker.rst index b7aa3d8..9dfd228 100644 --- a/docs/references/broker.rst +++ b/docs/references/broker.rst @@ -96,14 +96,14 @@ The ``listeners`` section allows to define network listeners which must be start The ``auth`` section setup authentication behaviour: -* ``plugins``: defines the list of activated plugins. Note the plugins must be defined in the ``hbmqtt.broker.plugins`` `entry point `_. +* ``plugins``: defines the list of activated plugins. Note the plugins must be defined in the ``amqtt.broker.plugins`` `entry point `_. * ``allow-anonymous`` : used by the internal :class:`hbmqtt.plugins.authentication.AnonymousAuthPlugin` plugin. This parameter enables (``on``) or disable anonymous connection, ie. connection without username. * ``password-file`` : used by the internal :class:`hbmqtt.plugins.authentication.FileAuthPlugin` plugin. This parameter gives to path of the password file to load for authenticating users. The ``topic-check`` section setup access control policies for publishing and subscribing to topics: * ``enabled``: set to true if you want to impose an access control policy. Otherwise, set it to false. -* ``plugins``: defines the list of activated plugins. Note the plugins must be defined in the ``hbmqtt.broker.plugins`` `entry point `_. +* ``plugins``: defines the list of activated plugins. Note the plugins must be defined in the ``amqtt.broker.plugins`` `entry point `_. * additional parameters: depending on the plugin used for access control, additional parameters should be added. * In case of ``topic_acl`` plugin, the Access Control List (ACL) must be defined in the parameter ``acl``. * For each username, a list with the allowed topics must be defined. diff --git a/pyproject.toml b/pyproject.toml index 422827c..1feb8ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,28 +42,29 @@ black = "^20.8b1" flake8 = "^3.9.0" [tool.poetry.scripts] -hbmqtt = 'hbmqtt.scripts.broker_script:main' -hbmqtt_pub = 'hbmqtt.scripts.pub_script:main' -hbmqtt_sub = 'hbmqtt.scripts.sub_script:main' +hbmqtt = 'amqtt.scripts.broker_script:main' +hbmqtt_pub = 'amqtt.scripts.pub_script:main' +hbmqtt_sub = 'amqtt.scripts.sub_script:main' [tool.poetry.plugins] -[tool.poetry.plugins."hbmqtt.test.plugins"] +[tool.poetry.plugins."amqtt.test.plugins"] "test_plugin" = "tests.plugins.test_manager:EmptyTestPlugin" "event_plugin" = "tests.plugins.test_manager:EventTestPlugin" -"packet_logger_plugin" = "hbmqtt.plugins.logging:PacketLoggerPlugin" +"packet_logger_plugin" = "amqtt.plugins.logging:PacketLoggerPlugin" -[tool.poetry.plugins."hbmqtt.broker.plugins"] -"event_logger_plugin" = "hbmqtt.plugins.logging:EventLoggerPlugin" -"packet_logger_plugin" = "hbmqtt.plugins.logging:PacketLoggerPlugin" -"auth_anonymous" = "hbmqtt.plugins.authentication:AnonymousAuthPlugin" -"auth_file" = "hbmqtt.plugins.authentication:FileAuthPlugin" -"topic_taboo" = "hbmqtt.plugins.topic_checking:TopicTabooPlugin" -"topic_acl" = "hbmqtt.plugins.topic_checking:TopicAccessControlListPlugin" -"broker_sys" = "hbmqtt.plugins.sys.broker:BrokerSysPlugin" +[tool.poetry.plugins."amqtt.broker.plugins"] +"event_logger_plugin" = "amqtt.plugins.logging:EventLoggerPlugin" +"packet_logger_plugin" = "amqtt.plugins.logging:PacketLoggerPlugin" +"auth_anonymous" = "amqtt.plugins.authentication:AnonymousAuthPlugin" +"auth_file" = "amqtt.plugins.authentication:FileAuthPlugin" +"topic_taboo" = "amqtt.plugins.topic_checking:TopicTabooPlugin" +"topic_acl" = "amqtt.plugins.topic_checking:TopicAccessControlListPlugin" +"broker_sys" = "amqtt.plugins.sys.broker:BrokerSysPlugin" -[tool.poetry.plugins."hbmqtt.client.plugins"] -"packet_logger_plugin" = "hbmqtt.plugins.logging:PacketLoggerPlugin" + +[tool.poetry.plugins."amqtt.client.plugins"] +"packet_logger_plugin" = "amqtt.plugins.logging:PacketLoggerPlugin" [build-system]