Skip to content

Commit efe8af5

Browse files
committed
fix: move to dataclass + requirements.txt
1 parent 4d2c482 commit efe8af5

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

hivemind_sqlite_database/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,20 @@
88

99
from hivemind_plugin_manager.database import Client, AbstractDB
1010

11+
from dataclasses import dataclass
1112

13+
14+
@dataclass
1215
class SQLiteDB(AbstractDB):
1316
"""Database implementation using SQLite."""
17+
name: str = "clients"
18+
subfolder: str = "hivemind-core"
1419

15-
def __init__(self, name="clients", subfolder="hivemind-core"):
20+
def __post_init__(self):
1621
"""
1722
Initialize the SQLiteDB connection.
1823
"""
19-
db_path = os.path.join(xdg_data_home(), subfolder, name + ".db")
24+
db_path = os.path.join(xdg_data_home(), self.subfolder, self.name + ".db")
2025
LOG.debug(f"sqlite database path: {db_path}")
2126
os.makedirs(os.path.dirname(db_path), exist_ok=True)
2227

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hivemind-plugin-manager>=0.1.0,<1.0.0

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def required(requirements_file):
4848
url='https://github.com/JarbasHiveMind/hivemind-sqlite-database',
4949
license='Apache-2.0',
5050
author='jarbasAi',
51-
# install_requires=required("requirements.txt"),
51+
install_requires=required("requirements.txt"),
5252
entry_points={'hivemind.database': PLUGIN_ENTRY_POINT},
5353
author_email='jarbasai@mailfence.com',
5454
description='sqlite database plugin for hivemind-core'

0 commit comments

Comments
 (0)