Skip to content

Commit

Permalink
allow to disable checking for the latest package version via env (#4407)
Browse files Browse the repository at this point in the history
  • Loading branch information
benedikt-bartscher authored Nov 21, 2024
1 parent 095c1e5 commit ecb5265
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions reflex/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,9 @@ class EnvironmentVariables:
# Where to save screenshots when tests fail.
SCREENSHOT_DIR: EnvVar[Optional[Path]] = env_var(None)

# Whether to check for outdated package versions.
REFLEX_CHECK_LATEST_VERSION: EnvVar[bool] = env_var(True)


environment = EnvironmentVariables()

Expand Down
2 changes: 2 additions & 0 deletions reflex/utils/prerequisites.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ def check_latest_package_version(package_name: str):
Args:
package_name: The name of the package.
"""
if environment.REFLEX_CHECK_LATEST_VERSION.get() is False:
return
try:
# Get the latest version from PyPI
current_version = importlib.metadata.version(package_name)
Expand Down

0 comments on commit ecb5265

Please sign in to comment.