Skip to content

Commit

Permalink
fix: add hivemind entrypoint to setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Dec 29, 2024
1 parent 8870766 commit e782372
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 6 additions & 2 deletions json_database/hpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
from ovos_utils.xdg_utils import xdg_data_home
from typing import Union, Iterable, List
from json_database import JsonStorageXDG
from dataclasses import dataclass


@dataclass
class JsonDB(AbstractDB):
"""HiveMind Database implementation using JSON files."""
name: str = "clients"
subfolder: str = "hivemind-core"

def __init__(self, name="clients", subfolder="hivemind-core"):
self._db = JsonStorageXDG(name, subfolder=subfolder, xdg_folder=xdg_data_home())
def __post_init__(self):
self._db = JsonStorageXDG(self.name, subfolder=self.subfolder, xdg_folder=xdg_data_home())
LOG.debug(f"json database path: {self._db.path}")

def sync(self):
Expand Down
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ def get_description():
return long_description


PLUGIN_ENTRY_POINT = 'hivemind-json-db-plugin=json_database.hpm:JsonDB'


setup(
name='json_database',
version=get_version(),
Expand All @@ -68,6 +71,7 @@ def get_description():
author_email='[email protected]',
install_requires=required('requirements.txt'),
description='searchable json database with persistence',
entry_points={'hivemind.database': PLUGIN_ENTRY_POINT},
long_description=get_description(),
long_description_content_type="text/markdown",
long_description_content_type="text/markdown"
)

0 comments on commit e782372

Please sign in to comment.