Skip to content

John6797/sc 8257/regularly check if the user is using an older#300

Merged
johnwalz97 merged 3 commits intomainfrom
john6797/sc-8257/regularly-check-if-the-user-is-using-an-older
Jan 27, 2025
Merged

John6797/sc 8257/regularly check if the user is using an older#300
johnwalz97 merged 3 commits intomainfrom
john6797/sc-8257/regularly-check-if-the-user-is-using-an-older

Conversation

@johnwalz97
Copy link
Contributor

@johnwalz97 johnwalz97 commented Jan 27, 2025

Internal Notes for Reviewers

Add background check to see if kernel is running the latest installed validmind version.

External Release Notes

@johnwalz97 johnwalz97 added enhancement New feature or request internal Not to be externalized in the release notes labels Jan 27, 2025
@johnwalz97 johnwalz97 requested a review from cachafla January 27, 2025 19:35
@github-actions
Copy link
Contributor

PR Summary

This pull request introduces a new feature to the ValidMind library that checks the version of the library running in a Jupyter notebook environment. The main functional changes include:

  • Version Check and Warning: A new function check_version is added to compare the installed version of the ValidMind library with the running version. If the installed version is newer, a warning message is displayed in the notebook, advising the user to restart the kernel to use the latest version.

    • The warning is displayed using HTML with a red color to ensure visibility.
    • The check is scheduled to run every 5 minutes using a daemon thread to ensure the user is notified if they update the library without restarting the kernel.
  • Utility Function: A utility function parse_version is added to parse semantic version strings into tuples of integers for easy comparison.

  • Notebook Environment Detection: The version check is only performed if the code is running in a Jupyter notebook, as determined by the is_notebook function.

These changes aim to improve user experience by ensuring that users are aware of version mismatches that could lead to unexpected behavior.

Test Suggestions

  • Test the version check functionality by simulating different installed and running versions of the library.
  • Verify that the warning message is correctly displayed in a Jupyter notebook when the installed version is newer.
  • Ensure that the warning is not displayed if the running version is up-to-date.
  • Test the parse_version function with various semantic version strings to ensure correct parsing.
  • Check that the version check is scheduled to run every 5 minutes and does not block the main thread.

Copy link
Contributor

@cachafla cachafla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome 👏

@johnwalz97 johnwalz97 merged commit cfbc2cf into main Jan 27, 2025
10 checks passed
@johnwalz97 johnwalz97 deleted the john6797/sc-8257/regularly-check-if-the-user-is-using-an-older branch January 27, 2025 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request internal Not to be externalized in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants