-
Notifications
You must be signed in to change notification settings - Fork 21
Warning Message for users using old versions #701
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
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
@Saga4 , we can't accept these changes unless @mihikap01 signs the CLA above |
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.
just some small changes,
also I think it's a lot of test cases, maybe 1 or 2 would do, besides they are failing for some reason
if latest_parsed.major > current_parsed.major or ( | ||
latest_parsed.major == current_parsed.major and latest_parsed.minor > current_parsed.minor | ||
): |
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.
personally, I prefer checking if latest_version < __version__
(major or minor)
@Saga4 what do you think ?
console.print( | ||
f"[bold blue]A newer version of Codeflash is available![/bold blue]\n" | ||
f"Current version: {__version__} | Latest version: {latest_version}\n" | ||
f"Consider upgrading for better quality optimizations.", | ||
style="blue", | ||
) |
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.
that's a lot of info, maybe just a simple one line message would do.
also I'm not a big fan of for better quality optimizations
,
the message should say something like "Things could behave unexpectedly"
also use the warning log level for that
User description
Closes ##631
closes #https://linear.app/codeflash-ai/issue/CF-700/print-a-warning-if-the-current-codeflash-version-is-not-the-latest
PR Type
Enhancement, Tests
Description
Add utilities to fetch and cache latest PyPI version
Notify users of newer minor or major releases
Integrate version check on CLI startup
Add comprehensive unit tests for version checking
Diagram Walkthrough
File Walkthrough
version_check.py
Add version check utilities
codeflash/code_utils/version_check.py
get_latest_version_from_pypi()
with 1h cachecheck_for_newer_minor_version()
logicmain.py
Integrate version check in main
codeflash/main.py
check_for_newer_minor_version()
at startuptest_version_check.py
Add tests for version check
tests/test_version_check.py