Skip to content

Commit f27f872

Browse files
committed
minor fixes
1 parent 5938547 commit f27f872

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

codeflash/code_utils/version_check.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from 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:

0 commit comments

Comments
 (0)