Skip to content

fix(cli): pass the --app-dir option to the uvicorn subprocess when the reload option is enabled.#4352

Merged
provinzkraut merged 1 commit intolitestar-org:mainfrom
IDrokin117:feature/gh-4329
Oct 3, 2025
Merged

fix(cli): pass the --app-dir option to the uvicorn subprocess when the reload option is enabled.#4352
provinzkraut merged 1 commit intolitestar-org:mainfrom
IDrokin117:feature/gh-4329

Conversation

@IDrokin117
Copy link
Copy Markdown
Contributor

@IDrokin117 IDrokin117 commented Sep 29, 2025

Description

Closes

Closes #4329

Summary

When --reload is enabled, spawns uvicorn subprocess with a fresh sys.path, which loses the --app-dir value. To preserve this value in sys.path, --app-dir must be explicitly passed to the uvicorn subprocess.

Test plan

  • test_run_command and test_arguments_passed might cover uvicorn parameter passing

Copy link
Copy Markdown
Contributor

@euri10 euri10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems reasonable to me, @litestar-org/maintainers you too ?

@provinzkraut provinzkraut enabled auto-merge (squash) October 3, 2025 12:56
@provinzkraut provinzkraut merged commit 84085df into litestar-org:main Oct 3, 2025
27 checks passed
@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 3, 2025

Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/4352

provinzkraut pushed a commit that referenced this pull request Oct 5, 2025
…the reload option is enabled. (#4352)

(cherry picked from commit 84085df)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error loading ASGI app. Could not import module "app". when using --reload with --app-dir

3 participants