commit 81f77f8bc3e1d996374680c7aad67741ce6aeb14 Author: hhh Date: Fri Feb 2 22:41:44 2024 +0200 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e08268f --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +/.idea/ +/tests/ + +poetry.lock + +*/__pycache__/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/neko_demo_impl/__init__.py b/neko_demo_impl/__init__.py new file mode 100644 index 0000000..2ae2839 --- /dev/null +++ b/neko_demo_impl/__init__.py @@ -0,0 +1 @@ +pass diff --git a/neko_demo_impl/modules/__init__.py b/neko_demo_impl/modules/__init__.py new file mode 100644 index 0000000..e83d678 --- /dev/null +++ b/neko_demo_impl/modules/__init__.py @@ -0,0 +1,4 @@ +""" +The implementation structure (except for the neko folder) +differs from the standard structure +""" diff --git a/neko_demo_impl/modules/d.py b/neko_demo_impl/modules/d.py new file mode 100644 index 0000000..6dfdaab --- /dev/null +++ b/neko_demo_impl/modules/d.py @@ -0,0 +1,15 @@ +from neko_demo_standard import DemoInterface + + +class RDemoInterface(DemoInterface): + @staticmethod + def some_very_useful_method(very_important_arg: str = "h") -> None: + """ + It can be some adapter for internal logic + """ + print(very_important_arg) + + +DemoInterface = RDemoInterface + +__all__ = ['DemoInterface'] diff --git a/neko_demo_impl/modules/dd.py b/neko_demo_impl/modules/dd.py new file mode 100644 index 0000000..5ae8c5f --- /dev/null +++ b/neko_demo_impl/modules/dd.py @@ -0,0 +1,24 @@ +from neko_demo_standard.__internal.some_internal_logic_mixins import ( + FirstAbstractMixin, + SecondAbstractMixin +) +from neko_demo_standard.neko.types import SomeDemoClass + + +class FirstMixin(FirstAbstractMixin): + def first_method(self): + print('first') + + +class SecondMixin(SecondAbstractMixin): + def second_method(self): + print('second') + + +class RSomeDemoClass(FirstMixin, SecondMixin, SomeDemoClass): + pass + + +SomeDemoClass = RSomeDemoClass + +__all__ = ['SomeDemoClass'] diff --git a/neko_demo_impl/modules/ddd.py b/neko_demo_impl/modules/ddd.py new file mode 100644 index 0000000..1d21c71 --- /dev/null +++ b/neko_demo_impl/modules/ddd.py @@ -0,0 +1,27 @@ +from neko_demo_standard.neko.types import SomeOtherDemoClass + + +class FirstMixin: + first = 'first' + + def first_method(self): + print(self.first) + + +class SecondMixin: + second = 'second' + + def second_method(self): + print(self.second) + + +class RSomeOtherDemoClass(FirstMixin, SecondMixin, SomeOtherDemoClass): + """ + Original SomeOtherDemoClass does not involve implementation with mixins, + but it is possible + """ + + +SomeOtherDemoClass = RSomeOtherDemoClass + +__all__ = ['SomeOtherDemoClass'] diff --git a/neko_demo_impl/neko/__init__.py b/neko_demo_impl/neko/__init__.py new file mode 100644 index 0000000..2ae2839 --- /dev/null +++ b/neko_demo_impl/neko/__init__.py @@ -0,0 +1 @@ +pass diff --git a/neko_demo_impl/neko/interfaces.py b/neko_demo_impl/neko/interfaces.py new file mode 100644 index 0000000..8f7c3a7 --- /dev/null +++ b/neko_demo_impl/neko/interfaces.py @@ -0,0 +1,4 @@ +from ..modules.d import DemoInterface + + +__all__ = ['DemoInterface'] diff --git a/neko_demo_impl/neko/types.py b/neko_demo_impl/neko/types.py new file mode 100644 index 0000000..5bedf2c --- /dev/null +++ b/neko_demo_impl/neko/types.py @@ -0,0 +1,10 @@ +from ..modules.dd import SomeDemoClass +from ..modules.ddd import SomeOtherDemoClass + + +__all__ = ['SomeDemoClass', 'SomeOtherDemoClass'] + +""" +Here, modules can be imported from internals of implementation, but they must be +present in the scope of the same (as in standard) file +""" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..e86c294 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,16 @@ +[tool.poetry] +name = "neko-demo-impl" +version = "0.1.0" +description = "" +authors = ["hhh"] +readme = "README.md" + +[tool.poetry.dependencies] +python = "^3.11" +neko-demo-standard = {git="https://github.com/nekomatad/neko-demo-standard.git"} +#neko-demo-standard = {path = "../neko-demo-standard", develop = true} + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api"