Skip to content

Commit

Permalink
Merge pull request #86 from python-ellar/ellar_074_upgrade
Browse files Browse the repository at this point in the history
Ellar 0.7.4 Upgrade
  • Loading branch information
eadwinCode authored Apr 25, 2024
2 parents 8366b66 + 029cc68 commit b8938bc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ellar_cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Ellar CLI Tool for Scaffolding Ellar Projects, Modules and also running Ellar Commands"""

__version__ = "0.4.0"
__version__ = "0.4.1"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ dependencies = [
# exclude 0.11.2 and 0.11.3 due to https://github.com/sdispater/tomlkit/issues/225
"tomlkit >=0.11.1,<1.0.0,!=0.11.2,!=0.11.3",
"uvicorn[standard] == 0.29.0",
"ellar >= 0.7.1",
"ellar >= 0.7.4",
"click >= 8.1.7",
]

Expand Down
23 changes: 15 additions & 8 deletions tests/sample_app/plain_project/plain_project/root_module.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
from ellar.app import current_injector
from ellar.common import (
IExecutionContext,
IModuleSetup,
JSONResponse,
Module,
Response,
exception_handler,
)
from ellar.core import Config, ModuleBase
from ellar.core import Config, DynamicModule, ModuleBase
from ellar.samples.modules import HomeModule

import ellar_cli.click as click


@click.command()
@click.with_app_context
def plain_project():
"""Project 2 Custom Command"""
assert isinstance(current_injector.get(Config), Config)
print("Plain Project Command works. Executed within application context")
@Module()
class DynamicCommandModule(ModuleBase, IModuleSetup):
@classmethod
def setup(cls) -> "DynamicModule":
@click.command()
@click.with_app_context
def plain_project():
"""Project 2 Custom Command"""
assert isinstance(current_injector.get(Config), Config)
print("Plain Project Command works. Executed within application context")

return DynamicModule(cls, commands=[plain_project])

@Module(modules=[HomeModule], commands=[plain_project])

@Module(modules=[HomeModule, DynamicCommandModule.setup()])
class ApplicationModule(ModuleBase):
@exception_handler(404)
def exception_404_handler(cls, ctx: IExecutionContext, exc: Exception) -> Response:
Expand Down

0 comments on commit b8938bc

Please sign in to comment.