-
Notifications
You must be signed in to change notification settings - Fork 21
Warning Message for users using old versions #631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
codeflash/version.py
Outdated
@@ -1,2 +1,6 @@ | |||
# These version placeholders will be replaced by uv-dynamic-versioning during build. | |||
<<<<<<< HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can remove this file from local version testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mihikap01 we can remove this file from the scope of this PR.
return | ||
|
||
# Get current version dynamically to handle runtime changes | ||
from codeflash.version import __version__ as current_version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we already have this as global import.
@@ -21,6 +22,17 @@ def main() -> None: | |||
CODEFLASH_LOGO, panel_args={"title": "https://codeflash.ai", "expand": False}, text_args={"style": "bold gold3"} | |||
) | |||
args = parse_args() | |||
|
|||
# Check for newer version (skip for version command to avoid confusion) | |||
if not args.version: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With version check 'codeflash --version' we can also show the status if its outdated.
# Check for newer version (skip for version command to avoid confusion) | ||
if not args.version: | ||
# Check if version check is disabled in config | ||
disable_version_check = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure we are going to add this in the configs or existing configs with customers.
We can just have a direct non blocking check.
return _version_cache["version"] | ||
|
||
try: | ||
response = requests.get("https://pypi.org/pypi/codeflash/json", timeout=10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can have quick timeout here to make it non blocking if there is network issue.
Tested here:
|
Prints warning messages when the user tries to run an old version of codeflash.
closes https://linear.app/codeflash-ai/issue/CF-700/print-a-warning-if-the-current-codeflash-version-is-not-the-latest