From ecb52651c3a134056bac5a59be1078685ec99d7d Mon Sep 17 00:00:00 2001 From: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com> Date: Thu, 21 Nov 2024 20:06:47 +0100 Subject: [PATCH] allow to disable checking for the latest package version via env (#4407) --- reflex/config.py | 3 +++ reflex/utils/prerequisites.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/reflex/config.py b/reflex/config.py index 962d6fec9..953a92b64 100644 --- a/reflex/config.py +++ b/reflex/config.py @@ -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() diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py index b2b3b7f3b..68d198711 100644 --- a/reflex/utils/prerequisites.py +++ b/reflex/utils/prerequisites.py @@ -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)