Skip to content

Commit cdb3e27

Browse files
authored
Merge pull request #25 from eadwinCode/ellar_refactor_fix
Ellar refactor fix
2 parents 2f7cdcc + cd0eca5 commit cdb3e27

File tree

24 files changed

+34
-40
lines changed

24 files changed

+34
-40
lines changed

ellar_cli/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
ELLAR_META = "ELLAR_META"
2+
ELLAR_PY_PROJECT = "ellar"

ellar_cli/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
import typing as t
44

55
import typer
6-
from ellar.commands import EllarTyper
7-
from ellar.constants import CALLABLE_COMMAND_INFO, MODULE_METADATA
6+
from ellar.common.commands import EllarTyper
7+
from ellar.common.constants import CALLABLE_COMMAND_INFO, MODULE_METADATA
88
from ellar.core.factory import AppFactory
99
from ellar.core.modules import ModuleSetup
10-
from ellar.services import Reflector
10+
from ellar.core.services import Reflector
1111
from typer import Typer
1212
from typer.models import CommandInfo
1313

@@ -61,7 +61,7 @@ def build_typers() -> t.Any:
6161

6262
if meta_ and meta_.has_meta:
6363
module_configs = AppFactory.get_all_modules(
64-
ModuleSetup(meta_.import_root_module()) # type: ignore
64+
ModuleSetup(meta_.import_root_module()) # type:ignore
6565
)
6666
reflector = Reflector()
6767

ellar_cli/manage_commands/create_module.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from importlib import import_module
55

66
import typer
7-
from ellar.helper.module_loading import module_dir
7+
from ellar.common.helper.module_loading import module_dir
88

99
from ellar_cli import scaffolding
1010
from ellar_cli.constants import ELLAR_META

ellar_cli/manage_commands/create_project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from importlib import import_module
55

66
import typer
7-
from ellar.helper.module_loading import module_dir
7+
from ellar.common.helper.module_loading import module_dir
88

99
from ellar_cli import scaffolding
1010
from ellar_cli.constants import ELLAR_META

ellar_cli/manage_commands/new.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import typing as t
55

66
import typer
7-
from ellar.helper.module_loading import module_dir
7+
from ellar.common.helper.module_loading import module_dir
88

99
from ellar_cli import scaffolding
1010
from ellar_cli.schema import EllarScaffoldSchema

ellar_cli/manage_commands/runserver.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
from pathlib import Path
55

66
import typer
7-
from ellar.helper.enums import create_enums_from_list
7+
from ellar.common.constants import LOG_LEVELS
8+
from ellar.common.helper.enums import create_enums_from_list
89
from h11._connection import DEFAULT_MAX_INCOMPLETE_EVENT_SIZE
910
from uvicorn.config import (
1011
HTTP_PROTOCOLS,

ellar_cli/scaffolding/module_template/module_name/controllers.ellar

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ class MyController(ControllerBase):
88
def index(self):
99
return {'detail': "Welcome Dog's Resources"}
1010
"""
11-
from ellar.common import Controller, get
12-
from ellar.core import ControllerBase
11+
from ellar.common import Controller, ControllerBase, get
1312

1413

1514
@Controller

ellar_cli/scaffolding/module_template/module_name/schemas.ellar

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@ class ASampleDTO(DataclassSerializer):
1313
name: str
1414
age: t.Optional[int] = None
1515
"""
16-
from ellar.serializer import DataclassSerializer, Serializer
17-
16+
from ellar.common import DataclassSerializer, Serializer
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
from ellar.core import TestClientFactory, TestClient
2-
1+
from ellar.testing import Test, TestClient

ellar_cli/scaffolding/project_template/project_name/config.ellar

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import typing as t
1010

1111
from pydantic.json import ENCODERS_BY_TYPE as encoders_by_type
1212
from starlette.middleware import Middleware
13-
from ellar.core.exceptions import IExceptionHandler
14-
from ellar.core import ConfigDefaultTypesMixin, JSONResponse
13+
from ellar.common import IExceptionHandler, JSONResponse
14+
from ellar.core import ConfigDefaultTypesMixin
1515
from ellar.core.versioning import BaseAPIVersioning, DefaultAPIVersioning
1616

1717

@@ -68,4 +68,3 @@ class BaseConfig(ConfigDefaultTypesMixin):
6868

6969
class DevelopmentConfig(BaseConfig):
7070
DEBUG: bool = True
71-

0 commit comments

Comments
 (0)