diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..597e9b4 --- /dev/null +++ b/LICENCE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Kodjo Sossouvi + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Readme.md b/README.md similarity index 100% rename from Readme.md rename to README.md diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..e7dc3f1 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,58 @@ +[build-system] +requires = ["setuptools>=80.9", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "dbengine" +version = "1.0.0" +description = "A lightweight, git-inspired database engine that maintains complete history of all modifications" +readme = "README.md" +requires-python = ">=3.8" +license = "MIT" +authors = [ + {name = "Kodjo Sossouvi", email = "kodjo.sossouvi@gmail.com"} +] +maintainers = [ + {name = "Kodjo Sossouvi", email = "kodjo.sossouvi@gmail.com"} +] +keywords = ["database", "versioning", "history", "git-inspired", "snapshot"] +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Database", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: System :: Archiving", +] + +dependencies = [] + +[project.optional-dependencies] +dev = [ + "pytest==8.4.2", +] + +[project.urls] +Homepage = "https://gitea.sheerka.synology.me/kodjo/MyDbEngine" +Documentation = "https://gitea.sheerka.synology.me/kodjo/MyDbEngine#readme" +Repository = "https://gitea.sheerka.synology.me/kodjo/MyDbEngine" +Issues = "https://gitea.sheerka.synology.me/kodjo/MyDbEngine/issues" + +[tool.setuptools] +package-dir = {"" = "src"} +packages = ["dbengine"] + +[tool.setuptools.package-data] +dbengine = ["py.typed"] + +[tool.pytest.ini_options] +testpaths = ["tests"] +python_files = ["test_*.py"] +python_classes = ["Test*"] +python_functions = ["test_*"] \ No newline at end of file diff --git a/src/core/__init__.py b/src/dbengine/__init__.py similarity index 100% rename from src/core/__init__.py rename to src/dbengine/__init__.py diff --git a/src/core/dbengine.py b/src/dbengine/dbengine.py similarity index 99% rename from src/core/dbengine.py rename to src/dbengine/dbengine.py index dd2cf6d..5fb80b6 100644 --- a/src/core/dbengine.py +++ b/src/dbengine/dbengine.py @@ -7,8 +7,8 @@ import os import pickle from threading import RLock -from core.serializer import Serializer -from core.utils import get_stream_digest +from dbengine.serializer import Serializer +from dbengine.utils import get_stream_digest TYPE_KEY = "__type__" TAG_PARENT = "__parent__" diff --git a/src/core/handlers.py b/src/dbengine/handlers.py similarity index 97% rename from src/core/handlers.py rename to src/dbengine/handlers.py index d63a2be..771a597 100644 --- a/src/core/handlers.py +++ b/src/dbengine/handlers.py @@ -2,7 +2,7 @@ import datetime -from core.utils import has_tag +from dbengine.utils import has_tag TAG_SPECIAL = "__special__" diff --git a/src/core/serializer.py b/src/dbengine/serializer.py similarity index 96% rename from src/core/serializer.py rename to src/dbengine/serializer.py index 99aaa4d..9209fdd 100644 --- a/src/core/serializer.py +++ b/src/dbengine/serializer.py @@ -1,8 +1,7 @@ import copy -from core.handlers import handlers -from core.utils import has_tag, is_dictionary, is_list, is_object, is_set, is_tuple, is_primitive, importable_name, \ - get_class, get_full_qualified_name, is_enum +from dbengine.handlers import handlers +from dbengine.utils import * TAG_ID = "__id__" TAG_OBJECT = "__object__" diff --git a/src/core/utils.py b/src/dbengine/utils.py similarity index 100% rename from src/core/utils.py rename to src/dbengine/utils.py diff --git a/tests/test_dbengine.py b/tests/test_dbengine.py index cb6ac54..2590668 100644 --- a/tests/test_dbengine.py +++ b/tests/test_dbengine.py @@ -3,7 +3,7 @@ import shutil import pytest -from core.dbengine import DbEngine, DbException, TAG_PARENT, TAG_USER, TAG_DATE +from dbengine.dbengine import DbEngine, DbException, TAG_PARENT, TAG_USER, TAG_DATE DB_ENGINE_ROOT = "TestDBEngineRoot" FAKE_TENANT_ID = "FakeTenantId" diff --git a/tests/test_serializer.py b/tests/test_serializer.py index 88e1c4f..5b0922a 100644 --- a/tests/test_serializer.py +++ b/tests/test_serializer.py @@ -6,7 +6,7 @@ from enum import Enum import pytest -from core.serializer import TAG_TUPLE, TAG_SET, Serializer, TAG_OBJECT, TAG_ID, TAG_REF +from dbengine.serializer import TAG_TUPLE, TAG_SET, Serializer, TAG_OBJECT, TAG_ID, TAG_REF class Obj: