Skip to content

use granian env_files option instead of reload hook#5512

Merged
adhami3310 merged 1 commit into
mainfrom
use-granian-env_files-option-instead-of-reload-hook
Jul 1, 2025
Merged

use granian env_files option instead of reload hook#5512
adhami3310 merged 1 commit into
mainfrom
use-granian-env_files-option-instead-of-reload-hook

Conversation

@adhami3310
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Refactors environment variable loading to use Granian's native env_files option instead of a custom reload hook, improving reliability and maintainability of .env file handling.

  • Removed custom _reload_hook from reflex/utils/exec.py in favor of Granian's built-in environment file loading
  • Added _paths_from_env_files and _paths_from_environment functions in reflex/environment.py for better separation of concerns
  • Modified reflex/config.py to use new helper functions for parsing environment paths
  • Switched from MPServer to Granian's Server class with native env_files support

3 files reviewed, no comments
Edit PR Review Bot Settings | Greptile

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jun 30, 2025

CodSpeed Performance Report

Merging #5512 will not alter performance

Comparing use-granian-env_files-option-instead-of-reload-hook (6d4e674) with main (e9c2e4b)

Summary

✅ 8 untouched benchmarks

@adhami3310 adhami3310 merged commit 33de56b into main Jul 1, 2025
40 of 41 checks passed
@adhami3310 adhami3310 deleted the use-granian-env_files-option-instead-of-reload-hook branch July 1, 2025 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants