allow to disable checking for the latest package version via env (#4407)
This commit is contained in:
parent
095c1e5b7f
commit
ecb52651c3
@ -547,6 +547,9 @@ class EnvironmentVariables:
|
|||||||
# Where to save screenshots when tests fail.
|
# Where to save screenshots when tests fail.
|
||||||
SCREENSHOT_DIR: EnvVar[Optional[Path]] = env_var(None)
|
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()
|
environment = EnvironmentVariables()
|
||||||
|
|
||||||
|
@ -93,6 +93,8 @@ def check_latest_package_version(package_name: str):
|
|||||||
Args:
|
Args:
|
||||||
package_name: The name of the package.
|
package_name: The name of the package.
|
||||||
"""
|
"""
|
||||||
|
if environment.REFLEX_CHECK_LATEST_VERSION.get() is False:
|
||||||
|
return
|
||||||
try:
|
try:
|
||||||
# Get the latest version from PyPI
|
# Get the latest version from PyPI
|
||||||
current_version = importlib.metadata.version(package_name)
|
current_version = importlib.metadata.version(package_name)
|
||||||
|
Loading…
Reference in New Issue
Block a user