-
Notifications
You must be signed in to change notification settings - Fork 497
feat: Add Python package version verification #1317
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?
feat: Add Python package version verification #1317
Conversation
…match prevention - Validate client-master version compatibility - Closes kvcache-ai#979
Summary of ChangesHello @LiYiMing-lg, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request implements a crucial version verification mechanism for the Mooncake Python package. Its primary purpose is to ensure that the client and server components are running compatible versions, thereby preventing common issues like invalid RPC arguments and ensuring stable connections. This change enhances the robustness and reliability of the Mooncake system by enforcing version consistency at runtime. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces version management to the Mooncake project by adding a __version__ string, a check_version_compatibility function, and a VersionMismatchError exception in mooncake/__init__.py. It also integrates a version validation check (_validate_mooncake_version) into the MooncakeConfig loading process, comparing the current client version against an expected version from an environment variable or the current package version, and updates setup.py to include package names and hardcoded versions for the generated wheels. Review comments suggest refactoring the version definition to a single source of truth in __init__.py and dynamically reading it in setup.py to avoid hardcoding, enhancing the version compatibility check to use semantic versioning (e.g., comparing major versions with the packaging library) instead of a strict equality check, and translating a newly added Chinese docstring in mooncake_config.py to English for consistency.
…ging library for semantic version parsing - Dynamic version reading in setup.py from __init__.py - Improved version compatibility check (major version match) - Ensure English documentation consistency
…ging library for semantic version parsing - Dynamic version reading in setup.py from __init__.py - Improved version compatibility check (major version match) - Ensure English documentation consistency
…ersion.parse for version comparison - Compare major versions only - Add fallback to exact match on parsing errors
…om/LiYiMing-lg/Mooncake into fix/979-version-verification-clean
…DA version if torch import fails - Improve CI compatibility
…rsion_compatibility - Add version-check extra dependency
|
这个关于Python包版本验证的PR已经准备就绪: 已完成:所有CI检查 主要修改:
如果方便的话,请您抽空审阅一下。有任何修改建议请随时提出,我会及时跟进。 谢谢! |
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.
Pull request overview
This PR aims to implement Python package version verification to prevent invalid RPC arguments caused by version mismatches between mooncake client and master, as described in issue #979. However, the implementation includes significant unrelated changes that should be addressed.
Key Changes:
- Added version compatibility checking mechanism with major version comparison
- Integrated version validation into config loading paths
- Made extensive modifications to setup.py that go beyond version verification scope
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| mooncake-wheel/mooncake/init.py | Introduces version constant (1.0.0), check_version_compatibility function with major version comparison logic, and VersionMismatchError exception class |
| mooncake-wheel/mooncake/mooncake_config.py | Adds _validate_mooncake_version function that checks version compatibility using MOONCAKE_EXPECTED_VERSION environment variable; integrated into from_file and load_from_env methods |
| mooncake-wheel/setup.py | Adds get_version function to extract version from init.py; introduces extensive BUILD_WITH_EP conditional logic with CUDA extension building and multiple package name variants (appears unrelated to PR purpose) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ror handling, use stderr for warnings
|
@Copilot All requested fixes implemented: CUDA logic removed from setup.py, Chinese comments fixed, error handling added. All CI checks passed. Please mark as resolved. |
|
@stmatengss @ShangmingCai
|
Description
Implementation of Python package version verification mechanism as requested in #979.
Changes
Related Issues
Closes #979
Checklist
Notes
Clean re-submission focusing only on #979 requirements.