Skip to content

Commit

Permalink
Fix/cli import (#1816)
Browse files Browse the repository at this point in the history
* fix: correct CLI import order

* chore: add warning comment

* chore: bump version

* fix: correct CLI import order
  • Loading branch information
Lancetnik authored Sep 25, 2024
1 parent 488bf44 commit 59b14f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion faststream/__about__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Simple and fast framework to create message brokers based microservices."""

__version__ = "0.5.24"
__version__ = "0.5.25"

SERVICE_NAME = f"faststream-{__version__}"
4 changes: 3 additions & 1 deletion faststream/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,13 @@ def run(

app, extra = parse_cli_args(app, *ctx.args)
casted_log_level = get_log_level(log_level)
module_path, app_obj = import_from_string(app)

if app_dir: # pragma: no branch
sys.path.insert(0, app_dir)

# Should be imported after sys.path changes
module_path, app_obj = import_from_string(app)

args = (app, extra, is_factory, casted_log_level)

if reload and workers > 1:
Expand Down

0 comments on commit 59b14f5

Please sign in to comment.