[PR #1315] [CLOSED] feat: add Python package version verification (closes #979) #2154

Closed
opened 2026-10-29 21:33:11 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/Mooncake/pull/1315
Author: @LiYiMing-lg
Created: 1/1/2026
Status: ❌ Closed

Base: main ← Head: version-verification-only


📝 Commits (3)

  • 489e91c feat(ci): add code coverage support with lcov and Codecov integration
  • 96e1c6c fix: add error handling to coverage generation to pass CI
  • 279c6d4 feat: add Python package version verification (closes #979)

📊 Changes

4 files changed (+91 additions, -4 deletions)

View changed files

📝 .github/workflows/ci.yml (+48 -4)
📝 mooncake-wheel/mooncake/__init__.py (+25 -0)
📝 mooncake-wheel/mooncake/mooncake_config.py (+14 -0)
📝 mooncake-wheel/setup.py (+4 -0)

📄 Description

Description

Implements Python package version verification as requested in #979 to prevent invalid RPC argument errors caused by version mismatches between client and master.

Changes

  1. Version definition: Added version="1.0.0" to setup.py for both CUDA and non-CUDA packages
  2. Version module: Added __version__, check_version_compatibility(), and VersionMismatchError to __init__.py
  3. Automatic validation: Added version validation in MooncakeConfig.load_from_env() and MooncakeConfig.from_file()
  4. Early prevention: Validation happens during configuration loading, preventing RPC errors before connections are established

Usage

# By default, validates that client version matches expected version
# Expected version defaults to client version (1.0.0)

# Can override expected version via environment variable
export MOONCAKE_EXPECTED_VERSION="1.0.0"

# Clear error message when versions don't match:
# VersionMismatchError: Mooncake version mismatch: client version=1.0.0, expected version=2.0.0.
# This may cause invalid RPC arguments. Please ensure client and server versions match.

---

<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/Mooncake/pull/1315 **Author:** [@LiYiMing-lg](https://github.com/LiYiMing-lg) **Created:** 1/1/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `version-verification-only` --- ### 📝 Commits (3) - [`489e91c`](https://github.com/kvcache-ai/Mooncake/commit/489e91c0863fc02b8dfde7d34503faa00f5b4325) feat(ci): add code coverage support with lcov and Codecov integration - [`96e1c6c`](https://github.com/kvcache-ai/Mooncake/commit/96e1c6c06bc4f06fc98e8bee417e69fccc045407) fix: add error handling to coverage generation to pass CI - [`279c6d4`](https://github.com/kvcache-ai/Mooncake/commit/279c6d423bec21edb453506eaf87b6f6983c176e) feat: add Python package version verification (closes #979) ### 📊 Changes **4 files changed** (+91 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+48 -4) 📝 `mooncake-wheel/mooncake/__init__.py` (+25 -0) 📝 `mooncake-wheel/mooncake/mooncake_config.py` (+14 -0) 📝 `mooncake-wheel/setup.py` (+4 -0) </details> ### 📄 Description ## Description Implements Python package version verification as requested in #979 to prevent invalid RPC argument errors caused by version mismatches between client and master. ### Changes 1. **Version definition**: Added `version="1.0.0"` to `setup.py` for both CUDA and non-CUDA packages 2. **Version module**: Added `__version__`, `check_version_compatibility()`, and `VersionMismatchError` to `__init__.py` 3. **Automatic validation**: Added version validation in `MooncakeConfig.load_from_env()` and `MooncakeConfig.from_file()` 4. **Early prevention**: Validation happens during configuration loading, preventing RPC errors before connections are established ### Usage ```bash # By default, validates that client version matches expected version # Expected version defaults to client version (1.0.0) # Can override expected version via environment variable export MOONCAKE_EXPECTED_VERSION="1.0.0" # Clear error message when versions don't match: # VersionMismatchError: Mooncake version mismatch: client version=1.0.0, expected version=2.0.0. # This may cause invalid RPC arguments. Please ensure client and server versions match. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:33:11 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/Mooncake#2154
No description provided.