From 8c5cb856e68f83c9c73f96e4d7c93788f806a98b Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Sun, 29 Dec 2024 01:16:50 +0000 Subject: [PATCH 1/6] fix: missing hivemind entrypoint in setup.py (#2) --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index 080a040..da522a9 100644 --- a/setup.py +++ b/setup.py @@ -39,6 +39,7 @@ def required(requirements_file): if pkg.strip() and not pkg.startswith("#")] +PLUGIN_ENTRY_POINT = 'hivemind-redis-db-plugin=hivemind_redis_database:RedisDB' setup( name='hivemind-redis-database', @@ -48,6 +49,7 @@ def required(requirements_file): license='Apache-2.0', author='jarbasAi', install_requires=required("requirements.txt"), + entry_points={'hivemind.database': PLUGIN_ENTRY_POINT}, author_email='jarbasai@mailfence.com', description='redis database plugin for hivemind-core' ) From 48bc64e1f785eff49f0009b9683a36105dd216a3 Mon Sep 17 00:00:00 2001 From: JarbasAl Date: Sun, 29 Dec 2024 01:17:05 +0000 Subject: [PATCH 2/6] Increment Version to 0.0.2a1 --- hivemind_redis_database/version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hivemind_redis_database/version.py b/hivemind_redis_database/version.py index 76c4342..3d283ec 100644 --- a/hivemind_redis_database/version.py +++ b/hivemind_redis_database/version.py @@ -1,6 +1,6 @@ # START_VERSION_BLOCK VERSION_MAJOR = 0 VERSION_MINOR = 0 -VERSION_BUILD = 1 -VERSION_ALPHA = 0 +VERSION_BUILD = 2 +VERSION_ALPHA = 1 # END_VERSION_BLOCK From 635d9fda7ae1624046f3480870ea72d4f27ad52f Mon Sep 17 00:00:00 2001 From: JarbasAl Date: Sun, 29 Dec 2024 01:17:22 +0000 Subject: [PATCH 3/6] Update Changelog --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..6188114 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +## [0.0.2a1](https://github.com/JarbasHiveMind/hivemind-redis-database/tree/0.0.2a1) (2024-12-29) + +[Full Changelog](https://github.com/JarbasHiveMind/hivemind-redis-database/compare/0.0.1...0.0.2a1) + +**Merged pull requests:** + +- fix: missing hivemind entrypoint in setup.py [\#2](https://github.com/JarbasHiveMind/hivemind-redis-database/pull/2) ([JarbasAl](https://github.com/JarbasAl)) + + + +\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* From 0a3735d87a62846bee2b7eabaec453c2f7c0e75a Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Sun, 29 Dec 2024 01:54:07 +0000 Subject: [PATCH 4/6] fix: missing hivemind entrypoint in setup.py (#4) * fix: missing hivemind entrypoint in setup.py * fix: move to remote db base class --- hivemind_redis_database/__init__.py | 25 ++++++++++++++----------- requirements.txt | 3 ++- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/hivemind_redis_database/__init__.py b/hivemind_redis_database/__init__.py index 3250a8d..8cf69e7 100644 --- a/hivemind_redis_database/__init__.py +++ b/hivemind_redis_database/__init__.py @@ -1,25 +1,28 @@ +from dataclasses import dataclass from typing import List, Union, Optional, Iterable import redis from ovos_utils.log import LOG -from hivemind_plugin_manager.database import Client, AbstractDB, cast2client +from hivemind_plugin_manager.database import Client, AbstractRemoteDB, cast2client -class RedisDB(AbstractDB): +@dataclass +class RedisDB(AbstractRemoteDB): """Database implementation using Redis with RediSearch support.""" - - def __init__(self, host: str = "127.0.0.1", port: int = 6379, password: Optional[str] = None, redis_db: int = 0): + host: str = "127.0.0.1" + port: int = 6379 + name: str = "clients" + subfolder: str = "hivemind-core" + password: Optional[str] = None + database_id: Optional[int] = None + + def __post_init__(self): """ Initialize the RedisDB connection. - - Args: - host: Redis server host. - port: Redis server port. - redis_db: Redis database index. """ - self.redis = redis.StrictRedis(host=host, port=port, db=redis_db, - password=password if password else None, + self.redis = redis.StrictRedis(host=self.host, port=self.port, db=self.database_id, + password=self.password if self.password else None, decode_responses=True) # TODO - support for a proper search index diff --git a/requirements.txt b/requirements.txt index 311862a..c2bb2b3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ -py-redis \ No newline at end of file +py-redis +hivemind-plugin-manager>=0.1.0,<1.0.0 \ No newline at end of file From d7ab5e4cf2b9a8efc4749a28ac2c25f04091d7e2 Mon Sep 17 00:00:00 2001 From: JarbasAl Date: Sun, 29 Dec 2024 01:54:25 +0000 Subject: [PATCH 5/6] Increment Version to 0.0.2a2 --- hivemind_redis_database/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hivemind_redis_database/version.py b/hivemind_redis_database/version.py index 3d283ec..6e7e2ae 100644 --- a/hivemind_redis_database/version.py +++ b/hivemind_redis_database/version.py @@ -2,5 +2,5 @@ VERSION_MAJOR = 0 VERSION_MINOR = 0 VERSION_BUILD = 2 -VERSION_ALPHA = 1 +VERSION_ALPHA = 2 # END_VERSION_BLOCK From 6e9899f111b562181713e50e955a7d07bb1bf2da Mon Sep 17 00:00:00 2001 From: JarbasAl Date: Sun, 29 Dec 2024 01:54:44 +0000 Subject: [PATCH 6/6] Update Changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6188114..861f280 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [0.0.2a2](https://github.com/JarbasHiveMind/hivemind-redis-database/tree/0.0.2a2) (2024-12-29) + +[Full Changelog](https://github.com/JarbasHiveMind/hivemind-redis-database/compare/0.0.2a1...0.0.2a2) + +**Merged pull requests:** + +- fix: missing hivemind entrypoint in setup.py [\#4](https://github.com/JarbasHiveMind/hivemind-redis-database/pull/4) ([JarbasAl](https://github.com/JarbasAl)) + ## [0.0.2a1](https://github.com/JarbasHiveMind/hivemind-redis-database/tree/0.0.2a1) (2024-12-29) [Full Changelog](https://github.com/JarbasHiveMind/hivemind-redis-database/compare/0.0.1...0.0.2a1)