File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change 1111from codeflash .version import __version__
1212
1313# Simple cache to avoid checking too frequently
14- _version_cache = {"version" : None , "timestamp" : 0 }
14+ _version_cache = {"version" : '0.0.0' , "timestamp" : float ( 0 ) }
1515_cache_duration = 3600 # 1 hour cache
1616
1717
@@ -69,14 +69,9 @@ def check_for_newer_minor_version() -> None:
6969
7070 # Check if there's a newer minor version available
7171 # We only notify for minor version updates, not patch updates
72- if latest_parsed .major > current_parsed .major or (
73- latest_parsed .major == current_parsed .major and latest_parsed .minor > current_parsed .minor
74- ):
75- console .print (
76- f"[bold blue]A newer version of Codeflash is available![/bold blue]\n "
77- f"Current version: { __version__ } | Latest version: { latest_version } \n "
78- f"Consider upgrading for better quality optimizations." ,
79- style = "blue" ,
72+ if latest_parsed > current_parsed : # < > == operators can be directly applied on version objects
73+ logger .warning (
74+ f"A newer version({ latest_version } ) of Codeflash is available, please update soon!"
8075 )
8176
8277 except version .InvalidVersion as e :
You can’t perform that action at this time.
0 commit comments